-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
avoid concrete examples for missingResourceError #45582
Conversation
Hi @CaoShuFeng. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/assign @janetkuo |
@k8s-bot ok to test |
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.
@CaoShuFeng, thanks for the fix. IMO it's a valid error when the resource isn't specified (missingResourceError
). It's one of general kubectl
usage errors, so I don't want to special case it for kubectl set
.
I'd like to hear more on why you think the error message is odd. What part of the original error message is confusing?
@janetkuo |
@k8s-bot verify test this |
@CaoShuFeng I see, that makes sense. Please put the options validation code in |
@janetkuo |
I tried your suggestion, but I found that error happens before we call Validate(), so it's difficult to check options in Validate(). |
@k8s-bot pull-kubernetes-federation-e2e-gce test this |
@CaoShuFeng I see, the In summary, change it to something like: var missingResourceError = fmt.Errorf(`You must provide one or more resources by argument or filename.
Example resource specifications include:
'-f app.yaml'
'--filename=app.json'
'<resource> <name>'
'<resource>'`) |
"missingResourceError" is a generic error for kubectl, so we should not use concrete examples in the error message.
@janetkuo |
@k8s-bot unit test this |
Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CaoShuFeng, janetkuo
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot gce etcd3 e2e test this |
Automatic merge from submit-queue |
missingResourceError uses pod and services as an example in error message. However some sub-commands doesn't support pod/service, this change use
<resource> <name>
instead of concrete examples.Before this change:
After this change:
Release note: