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

Update resource builder error message to be more clear #9735

Conversation

juanvallejo
Copy link
Contributor

@juanvallejo juanvallejo commented Jul 7, 2016

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:
  1. Run command "# oc get pod pods/docker-registry-4-3tesd"
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 of oc get resource resource/<resource_name>"

Related bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1342383
Related UPSTREAM: kubernetes/kubernetes#28626

@juanvallejo
Copy link
Contributor Author

@fabianofranz Could you please take a look?

@juanvallejo
Copy link
Contributor Author

[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>`")
Copy link
Member

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 ``` :)

@fabianofranz
Copy link
Member

LGTM, can be proposed upstream

@juanvallejo juanvallejo force-pushed the jvallejo_update-resource-builder-format-error branch from 060ef17 to 775b8ee Compare July 7, 2016 19:17
@juanvallejo juanvallejo changed the title UPSTREAM: 0000: update resource builder error message to be more clear Update resource builder error message to be more clear Jul 7, 2016
@juanvallejo juanvallejo force-pushed the jvallejo_update-resource-builder-format-error branch 2 times, most recently from fb04408 to 6cd66bb Compare July 7, 2016 20:44
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 11, 2016
@juanvallejo juanvallejo force-pushed the jvallejo_update-resource-builder-format-error branch from 6cd66bb to d808595 Compare July 13, 2016 15:55
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to d808595

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6203/)

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2016
@juanvallejo
Copy link
Contributor Author

juanvallejo commented Jul 13, 2016

@fabianofranz PR merged upstream: kubernetes/kubernetes#28626

@fabianofranz
Copy link
Member

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 14, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6283/) (Image: devenv-rhel7_4591)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to d808595

@openshift-bot openshift-bot merged commit 618e6e9 into openshift:master Jul 14, 2016
@juanvallejo juanvallejo deleted the jvallejo_update-resource-builder-format-error branch July 14, 2016 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants