Skip to content
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

Merged
merged 1 commit into from
Jul 5, 2016

Conversation

asalkeld
Copy link

@asalkeld asalkeld commented May 11, 2016

* A new command "kubectl config get-contexts" has been added.

fixes #25383

@k8s-bot
Copy link

k8s-bot commented May 11, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

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
@k8s-bot
Copy link

k8s-bot commented May 11, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

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.

@k8s-bot
Copy link

k8s-bot commented May 11, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

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.

@k8s-github-robot k8s-github-robot added kind/old-docs size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 11, 2016
"shaker-context": {AuthInfo: "green-user", Cluster: "horse-cluster", Namespace: "chisel-ns"}}}
test := listContextTest{
startingConfig: tconfig,
expectedOut: "queen-anne-context\nshaker-context\n",
Copy link
Member

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.

Copy link
Member

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.

@bgrant0607 bgrant0607 assigned deads2k and unassigned bgrant0607 May 11, 2016

cmd := &cobra.Command{
Use: "list-context",
Short: "List the current-contexts",
Copy link
Member

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

@deads2k
Copy link
Contributor

deads2k commented May 11, 2016

@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",
Copy link
Member

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.

@bgrant0607
Copy link
Member

@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.

@asalkeld
Copy link
Author

Thanks for the review @bgrant0607 and @deads2k, I'll re-work this to better fit in.

@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 13, 2016
@asalkeld
Copy link
Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2016

@k8s-bot
Copy link

k8s-bot commented Jun 18, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

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
@k8s-bot
Copy link

k8s-bot commented Jun 20, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

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.

@k8s-bot
Copy link

k8s-bot commented Jun 21, 2016

GCE e2e build/test passed for commit f40ba00414124b254c337f6815304a7079b56e7b.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2016
@k8s-github-robot k8s-github-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 28, 2016
@asalkeld
Copy link
Author

Rebased and @deads2k it now includes "git branch" style *

$ kubectl config get-contexts
CURRENT   NAME      CLUSTER   AUTHINFO   NAMESPACE
          fluffy    local     bear       
*         local     local                
$ kubectl config get-contexts -o name
  fluffy
* local

@k8s-bot
Copy link

k8s-bot commented Jun 28, 2016

GCE e2e build/test passed for commit 2a9e3ab98a898644fca1dfefd6b886b66586c7c1.

@deads2k
Copy link
Contributor

deads2k commented Jun 28, 2016

Rebased and @deads2k it now includes "git branch" style *

Sorry, can't do that with -o name. That flag is intended for scripts and a * in the output could cause them trouble.

@asalkeld
Copy link
Author

ok, i'll remove it out of -o name.

@k8s-bot
Copy link

k8s-bot commented Jun 28, 2016

GCE e2e build/test passed for commit 63ef43428a843068d0963a98774bbfb64108ca25.

@deads2k deads2k added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 28, 2016
@deads2k
Copy link
Contributor

deads2k commented Jun 29, 2016

CI says

FAILED ./hack/../hack/verify-generated-docs.sh 148s

@asalkeld
Copy link
Author

asalkeld commented Jul 4, 2016

rebased, and fixed the generated docs failure..

@k8s-github-robot k8s-github-robot added kind/old-docs and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jul 4, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 4, 2016

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
@k8s-bot
Copy link

k8s-bot commented Jul 5, 2016

GCE e2e build/test passed for commit e0ce987.

@deads2k deads2k added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 5, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jul 5, 2016

GCE e2e build/test passed for commit e0ce987.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit a75cb46 into kubernetes:master Jul 5, 2016
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Dec 13, 2020
…ation

[release-3.11] Bug 1760807: Update pod affinity check in priority for valid labels

Origin-commit: 1948f11155e97fe3f115c0beb4bae800f41bd2e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add kubectl config list-contexts
8 participants