-
Notifications
You must be signed in to change notification settings - Fork 135
Allow rules_k8s targets to be invoked within other Bazel targets #634
Allow rules_k8s targets to be invoked within other Bazel targets #634
Conversation
The current logic for finding the runfiles directory only works when the targets created by rules_k8s are invoked directly. Creating a sh_binary() that chains multiple commands together doesn't work, as the placement of the script relative to the runfiles directory will be different. This issue also affected rules_docker at some point in the past. This change basically imports the new guess_runfiles() logic that rules_docker uses.
Hi @EdSchouten. Thanks for your PR. I'm waiting for a bazelbuild member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
popd > /dev/null 2>&1 | ||
if [ -d ${BASH_SOURCE[0]}.runfiles ]; then | ||
# Runfiles are adjacent to the current script. | ||
echo "$( cd ${BASH_SOURCE[0]}.runfiles && pwd )" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also be written as:
(cd ${BASH_SOURCE[0]}.runfiles && pwd)
But I'd rather not deviate from what rules_docker does.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chases2, EdSchouten The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@EdSchouten: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Looks like CI failed due to flakiness, and I can't retrigger this myself. :-( |
/test all |
You can most definitely trigger it yourself! See the |
/ok-to-test |
Thank you! |
The message says you need to wait for an |
The current logic for finding the runfiles directory only works when the
targets created by rules_k8s are invoked directly. Creating a
sh_binary() that chains multiple commands together doesn't work, as the
placement of the script relative to the runfiles directory will be
different.
This issue also affected rules_docker at some point in the past. This
change basically imports the new guess_runfiles() logic that
rules_docker uses.