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
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
6 similar comments
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
@@ -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 |
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.
@deads2k is this done for a reason here?
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.
@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.
Most of this PR looks fine. I'm not sure why you are removing the dynamic code in |
@k8s-bot ok to test |
Thanks for the heads up. Generally, yes, we care about being able to substitute the available types, but |
@@ -49,6 +49,9 @@ var ( | |||
func NewCmdRolloutHistory(f *cmdutil.Factory, out io.Writer) *cobra.Command { | |||
options := &HistoryOptions{} | |||
|
|||
validArgs := []string{"deployment"} |
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.
@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.
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.
@deads2k definitely. As a short-term solution could this be an argument in NewCmdRolloutHistory
?
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.
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.
Me neither, I'm ok with addressing it apart of this PR.
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.
We already have ported rollout history
. Make sure this is configurable because it needs to work with deploymentconfigs too
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.
@Kargakis, any suggestions to make it configurable? or @fabianofranz can take care of this in a new PR?
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.
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
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.
Hm, are these changes helping in fixing completion?
Doc in cobra says "yes".
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.
Just noticed it, thanks. Are we going to end up with a factory method that needs to separate between commands?
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.
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.
We should also support it's alias. @xingzhou |
agree we should support the alias. |
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? |
@xingzhou anything block you add alias support in this PR? |
@adohe, no, just curious of how to split PRs. I will add one more commit here to resolve taint alias issue. |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
LGTM, thanks for the PR. |
@xingzhou @brendandburns please squash before we can merge. |
This path added/fixed bash completion for several kubectl commands. Fixes kubernetes#25287
Rebased and squashed into one commit |
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
LGTM again. |
GCE e2e build/test passed for commit 80d6cd0. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 80d6cd0. |
Automatic merge from submit-queue |
This commit is in 1.4 already. |
|
Added bash completion for several kubectl commands.
Fixes #25287
This change is