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

Fixed incomplete kubectl bash completion. #31333

Merged
merged 1 commit into from Sep 1, 2016

Conversation

xingzhou
Copy link
Contributor

@xingzhou xingzhou commented Aug 24, 2016

Added bash completion for several kubectl commands.

Fixes #25287


This change is Reviewable

@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

6 similar comments
@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@k8s-bot
Copy link

k8s-bot commented Aug 24, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels Aug 24, 2016
@@ -76,16 +75,6 @@ var (
func NewCmdTaint(f *cmdutil.Factory, out io.Writer) *cobra.Command {
options := &TaintOptions{}

// retrieve a list of handled resources from printer as valid args
Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k is this done for a reason here?

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k is this done for a reason here?

I hadn't noticed this code before. It's definitely incorrect for this command and its not a very clean way of getting the data for the completions overall. Removing it here is good.

@brendandburns
Copy link
Contributor

Most of this PR looks fine. I'm not sure why you are removing the dynamic code in taint, I want to double check with @deads2k that this won't break anything upstream.

@brendandburns
Copy link
Contributor

@k8s-bot ok to test

@brendandburns brendandburns added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Aug 25, 2016
@deads2k
Copy link
Contributor

deads2k commented Aug 25, 2016

I want to double check with @deads2k that this won't break anything upstream.

Thanks for the heads up. Generally, yes, we care about being able to substitute the available types, but kubectl taint is a special case that only works against nodes.

@@ -49,6 +49,9 @@ var (
func NewCmdRolloutHistory(f *cmdutil.Factory, out io.Writer) *cobra.Command {
options := &HistoryOptions{}

validArgs := []string{"deployment"}
Copy link
Contributor

Choose a reason for hiding this comment

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

@fabianofranz You should think of a way for us to refactor this to have these completions work well for us. I don't think it needs to be resolved in this pull, but we'll want some way to add dc and deploymentconfig here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k definitely. As a short-term solution could this be an argument in NewCmdRolloutHistory?

Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k definitely. As a short-term solution could this be an argument in NewCmdRolloutHistory?

I can't say that I'm a fan of that. I think we should let this merge and you can work it out with @Kargakis since he's trying to integrate these with openshift.

Copy link
Contributor

Choose a reason for hiding this comment

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

Me neither, I'm ok with addressing it apart of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

We already have ported rollout history. Make sure this is configurable because it needs to work with deploymentconfigs too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Kargakis, any suggestions to make it configurable? or @fabianofranz can take care of this in a new PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, are these changes helping in fixing completion? If not, then let's just drop them. The rollout commands already know their valid resources via the factory:

$ kc rollout history no/127.0.0.1
error: no history viewer has been implemented for {"" "Node"}

The error message should be cleaned up in #31234

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, are these changes helping in fixing completion?

Doc in cobra says "yes".

Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticed it, thanks. Are we going to end up with a factory method that needs to separate between commands?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just noticed it, thanks. Are we going to end up with a factory method that needs to separate between commands?

Maybe. I see what's been done here as strictly better than the current state of affairs. I'd let this go in and @fabianofranz and team can fix it up in the 1.5 timeframe.

@adohe-zz
Copy link

We should also support it's alias. @xingzhou

@brendandburns
Copy link
Contributor

agree we should support the alias.

@xingzhou
Copy link
Contributor Author

ok, @adohe and @brendandburns, do you think we can open a new ticket for supporting the alias "no" for command taint? In my mind, this can be a separate PR, this one only can be used for fixing command bash completion. If you agree, I can provide a patch later and we can move forward for this PR?

@adohe-zz
Copy link

@xingzhou anything block you add alias support in this PR?

@xingzhou
Copy link
Contributor Author

@adohe, no, just curious of how to split PRs. I will add one more commit here to resolve taint alias issue.

@k8s-bot
Copy link

k8s-bot commented Aug 30, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

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

LGTM, thanks for the PR.

@adohe-zz
Copy link

@xingzhou @brendandburns please squash before we can merge.

This path added/fixed bash completion for several
kubectl commands.

Fixes kubernetes#25287
@xingzhou
Copy link
Contributor Author

Rebased and squashed into one commit

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2016
@k8s-bot
Copy link

k8s-bot commented Aug 30, 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 will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@brendandburns
Copy link
Contributor

LGTM again.

@brendandburns brendandburns added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 1, 2016
@k8s-bot
Copy link

k8s-bot commented Sep 1, 2016

GCE e2e build/test passed for commit 80d6cd0.

@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 Sep 1, 2016

GCE e2e build/test passed for commit 80d6cd0.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit c98a1e2 into kubernetes:master Sep 1, 2016
@pwittrock pwittrock added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 7, 2016
@foxish foxish removed the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 8, 2016
@foxish
Copy link
Contributor

foxish commented Sep 8, 2016

This commit is in 1.4 already.

@pwittrock
Copy link
Member

git branch --contains 80d6cd0
master

  • release-1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet