-
Notifications
You must be signed in to change notification settings - Fork 4.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
Update resource builder error message to be more clear #9735
Update resource builder error message to be more clear #9735
Conversation
@fabianofranz Could you please take a look? |
[test] |
@@ -354,7 +354,8 @@ func hasCombinedTypeArgs(args []string) (bool, error) { | |||
case hasSlash > 0 && hasSlash == len(args): | |||
return true, nil | |||
case hasSlash > 0 && hasSlash != len(args): | |||
return true, fmt.Errorf("when passing arguments in resource/name form, all arguments must include the resource") | |||
// return true, fmt.Errorf("when passing arguments in resource/name form, all arguments must include the resource") | |||
return true, fmt.Errorf("there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. `oc get resource/<resource_name>` instead of `oc get resource resource/<resource_name>`") |
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.
no markdown support in bash yet, so use '
instead of ``` :)
LGTM, can be proposed upstream |
060ef17
to
775b8ee
Compare
fb04408
to
6cd66bb
Compare
6cd66bb
to
d808595
Compare
Evaluated for origin test up to d808595 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6203/) |
@fabianofranz PR merged upstream: kubernetes/kubernetes#28626 |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6283/) (Image: devenv-rhel7_4591) |
Evaluated for origin merge up to d808595 |
The error message given by command line "oc get" is sometimes of no help / not clear on what must be corrected, e.g.:
oc get pod pods/docker-registry-4-3tesd
error: when passing arguments in resource/name form, all arguments must include the resource
oc get bc bc/not-existing-bc
error: when passing arguments in resource/name form, all arguments must include the resource
Steps to Reproduce:
Actual Result:
Get unfriendly error message which is of no help:
"error: when passing arguments in resource/name form, all arguments must include the resource"
Expected Result:
Error message should recommend end user to run this cli in good grammar: "# oc get po docker-registry-4-3tesd"
Before
"error: when passing arguments in resource/name form, all arguments must include the resource"
After
"error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g.
oc get resource/<resource_name>
instead ofoc get resource resource/<resource_name>
"Related bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1342383
Related UPSTREAM: kubernetes/kubernetes#28626