-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Redundant call to WithAll in NewWaitFlags #79123
Conversation
@apelisse can you take a look ? |
@@ -93,7 +93,7 @@ func NewWaitFlags(restClientGetter genericclioptions.RESTClientGetter, streams g | |||
WithFieldSelector(""). | |||
WithAll(false). | |||
WithAllNamespaces(false). | |||
WithAll(false). | |||
WithLocal(false). |
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.
Yeah, I don't think this really makes a difference since the variable would be initialized to false anyway. Expliciit initialization doesn't hurt.
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.
@apelisse The --local
flag of kubectl wait
appeared in v1.16.0 due to initializing the variable.
$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
$ kubectl wait -h | grep local
--local=false: If true, annotation will NOT contact api-server but run locally.
How does the flag work in kubectl wait
? If it have no effects, the variable should not be initialized.
/lgtm |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, tedyu 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
In NewWaitFlags, WithAll is called twice.
If I read the code correctly, the redundant call should be replaced with WithLocal().