-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command "kubectl config get-contexts" #25463
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
2 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
"shaker-context": {AuthInfo: "green-user", Cluster: "horse-cluster", Namespace: "chisel-ns"}}} | ||
test := listContextTest{ | ||
startingConfig: tconfig, | ||
expectedOut: "queen-anne-context\nshaker-context\n", |
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.
Please ensure that the contexts are sorted in a deterministic order.
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.
It would also be useful to see the context properties (AuthInfo, Cluster, Namespace), in columnar form.
|
||
cmd := &cobra.Command{ | ||
Use: "list-context", | ||
Short: "List the current-contexts", |
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.
It's all contexts not just the current-context
@bgrant0607 This would be another command that is "different" as noted in #20605. Just want to make sure you're ok with another one before we go too far down this path. |
options := &ListContextOptions{configAccess: configAccess} | ||
|
||
cmd := &cobra.Command{ | ||
Use: "list-context", |
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.
Please call it get-context
. list
is not an ordinary kubectl command, but get
is.
kubectl get-context
should print all contexts.
kubectl get-context <context-name>
should print just the selected context.
kubectl get-context -o name
should print the names of all contexts.
@deads2k I'm ok with it, though we should try to make it as similar to other commands as we can, hence my comments about get vs. list, columnar output, etc. At some point, we'll need to redo the whole command group. |
Thanks for the review @bgrant0607 and @deads2k, I'll re-work this to better fit in. |
Please let me know if I should squash these commits, there is a lot of renaming going on. |
@@ -0,0 +1,169 @@ | |||
/* | |||
Copyright 2014 The Kubernetes Authors All rights reserved. |
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.
2016
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
1 similar comment
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message may repeat a few times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. Otherwise, if this message is too spammy, please complain to ixdy. |
GCE e2e build/test passed for commit f40ba00414124b254c337f6815304a7079b56e7b. |
Rebased and @deads2k it now includes "git branch" style *
|
GCE e2e build/test passed for commit 2a9e3ab98a898644fca1dfefd6b886b66586c7c1. |
Sorry, can't do that with |
ok, i'll remove it out of -o name. |
GCE e2e build/test passed for commit 63ef43428a843068d0963a98774bbfb64108ca25. |
CI says FAILED ./hack/../hack/verify-generated-docs.sh 148s |
rebased, and fixed the generated docs failure.. |
GCE e2e build/test passed for commit b0632847c72f0eb5fc17f40ba8bfa089b6a69bdd. |
Note: Context is not a runtime object (doesn't have Kind and Version) so we can't use the resource_printer
GCE e2e build/test passed for commit e0ce987. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit e0ce987. |
Automatic merge from submit-queue |
…ation [release-3.11] Bug 1760807: Update pod affinity check in priority for valid labels Origin-commit: 1948f11155e97fe3f115c0beb4bae800f41bd2e2
fixes #25383