-
Notifications
You must be signed in to change notification settings - Fork 136
Adds 'context' parameter to k8s_object #138
Conversation
* Adds 'context' parameter to k8s_object This commit introduces a new parameter to k8s_object, in order to manually specify the 'context' from the local kubeconfig file. This is necessary in addition to the 'cluster' parameter in cases where the bazel rule should be applied into a 'context' which is configured on the local machine, but not currently selected. * Adds clarifying comment about default behaviour * Adds context to all other rules in addition to apply
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! (I believe my company has signed) |
Ok, NOW it should confirmed signed. |
CLAs look good, thanks! |
Does your |
k8s/object.bzl
Outdated
|
||
# If the 'context' parameter is not set by the caller, | ||
# this value becomes an empty string, and kubectl | ||
# will be run like `kubectl --context= ...` In this |
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.
Would want this to be kubectl --context={cluster}
instead?
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.
No it seems like --context=
is better
/assign |
@fejta Well - in my personal In fact, the first tests of this PR didn't add an extra bazel parameter and just modified the I hope I'm understanding your comment correctly! |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
k8s/object.bzl
Outdated
|
||
# If the 'context' parameter is not set by the caller, | ||
# this value becomes an empty string, and kubectl | ||
# will be run like `kubectl --context= ...` In this |
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.
No it seems like --context=
is better
@fejta Great, thanks for reviewing! I'm not sure what else needs to be done, or if an owner like you just needs to press the button. |
I need this to pass e2e tests. There's an issue where travis cannot test PRs from other repos. I'm fixing this by migrating to prow. I'll merge the PR once this is done. Thanks very much for your patience! |
Ok, no problem! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fejta, jasongwartz 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 |
/ok-to-test |
/lgtm |
New changes are detected. LGTM label has been removed. |
/test pull-rules-k8s-e2e |
/override cla/google |
@fejta: Overrode contexts on behalf of fejta: cla/google 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. |
Apologies for opening this a second time. I had to rebase in order to get the right email address in the commit (for the CLA).
Related: #135
This PR introduces a new parameter to k8s_object, in order to manually specify the 'context' from the local kubeconfig file.
This is necessary in addition to the 'cluster' parameter in cases where the bazel rule should be applied into a 'context' which is configured on the local machine, but not currently selected.
For example: in our use case, we have a macro which generates and runs k8s_object rules for all of our deploy environments and clusters (dev, prod, multiple clusters) - which means it needs to run apply against different 'contexts' consecutively without changing the kubectl context.
cc @Globegitter