-
Notifications
You must be signed in to change notification settings - Fork 136
Fix getting the current cluster name in README.md #214
Conversation
* Get the actual cluster name from the current context instead of the current context name
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
|
/assign @fejta |
CLAs look good, thanks! |
@@ -106,7 +106,7 @@ k8s_defaults( | |||
name = "k8s_deploy", | |||
kind = "deployment", | |||
# This is the name of the cluster as it appears in: | |||
# kubectl config current-context | |||
# kubectl config view --minify -o=jsonpath='{.contexts[0].context.cluster}' |
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.
@nlopezgi
Context is the combination of user + cluster. By default gcloud will set user, cluster and context to be the same thing (probably why this bug exists) but that need not be the case. Totally possible that other distros besides GKE do something different.
Context may actually be what most people want here (and is typically what people use). Probably worth providing a context
parameter here in addition to cluster
(which is probably better than repurposing cluster to be cluster).
@mattmoor can you comment on the history here? Is this an accident or intentional?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fejta 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 |
/retest |
1 similar comment
/retest |
/assign @smukherj1 Any idea why this keeps failing? Are we out of quota? |
/retest |
Also @smukherj1 @nlopezgi can you trigger the non prow builds? |
Opened #216 to hopefully reduce e2e flakiness |
The current documentation suggests using the current context name (provided by
kubectl config current-context
) as cluster name.This does not work in configurations in which there is a mismatch between the cluster and context name (_e.g., K8s provided by Docker for Mac).
This pull request fixes this by using the output of
kubectl config view --minify -o=jsonpath='{.contexts[0].context.cluster}'
instead.Fixes #213