Description of problem: When run 'oc get' without any resource specified, the error message "error: Required resource not specified" is printed on later part of long output, it's hard to notice this error message Version-Release number of selected component (if applicable): oc v3.5.0.5+8f2840d kubernetes v1.5.2+43a9be4 How reproducible: Always Steps to Reproduce: 1. Run 'oc get' without resource specified # oc get You must specify the type of resource to get. Valid resource types include: * buildconfigs (aka 'bc') * builds ...... * thirdpartyresources error: Required resource not specified. Use "oc explain <resource>" for a detailed description of that resource (e.g. oc explain pods). See 'oc get -h' for help and examples. Actual results: 1. The error message "error: Required resource not specified" is aligned with resource types Expected results: 1. The best solution is to put error message 'error: Required resource not specified' at the first line of output(that's before message"You must specify the type of resource...."). Another choice is to remove the space before the message "error: Required resource not specified."in which case the error message is more obvious to notice to match with 3.4.0.39(Output in 3.4.0.39 will be added in Additional info) Additional info: $ oc version openshift v3.4.0.39 kubernetes v1.4.0+776c994 $ oc get # oc get You must specify the type of resource to get. Valid resource types include: ........... * users error: Required resource not specified. Use "oc explain <resource>" for a detailed description of that resource (e.g. oc explain pods). See 'oc get -h' for help and examples.
Placing the error message near the beginning might make it more difficult to notice than it already is, as a user would have to know to scroll to the beginning of a long output to see it. I like your idea of removing the space before it. We could do something like: ``` # oc get You must specify the type of resource to get. Valid resource types include: * buildconfigs (aka 'bc') * builds ...... * thirdpartyresources error: Required resource not specified. Use "oc explain <resource>" for a detailed description of that resource (e.g. oc explain pods). See 'oc get -h' for help and examples. ``` WDYT? Will open PR
Hi, @yapei, you might miss this.
Thanks wmeng @Juan, I'm ok with your solution like this: ``` # oc get You must specify the type of resource to get. Valid resource types include: * buildconfigs (aka 'bc') * builds ...... * thirdpartyresources error: Required resource not specified. Use "oc explain <resource>" for a detailed description of that resource (e.g. oc explain pods). See 'oc get -h' for help and examples. ```
Upstream PR: https://github.com/kubernetes/kubernetes/pull/52450
Upstream PR has merged [1]. Will be available after next rebase. 1. https://github.com/kubernetes/kubernetes/pull/52450
This is available since 3.9, moving to qa.
# oc version oc v3.9.71 kubernetes v1.9.1+a0ce1bc657 features: Basic-Auth GSSAPI Kerberos SPNEGO Server <server> openshift v3.9.71 kubernetes v1.9.1+a0ce1bc657 # git clone https://github.com/openshift/kubernetes & cd kubernetes $ git log --pretty="%h %an %cd - %s" a0ce1bc657 | grep '#52450' // PR is merged in v3.9.71 4a0f41e4fa Kubernetes Submit Queue Sat Sep 23 18:48:58 2017 -0700 - Merge pull request #52450 from juanvallejo/jvallejo/misc-err-msg-improvements # oc get You must specify the type of resource to get. Valid resource types include: * all * buildconfigs (aka 'bc') * builds * certificatesigningrequests (aka 'csr') * clusterrolebindings * clusterroles * componentstatuses (aka 'cs') * configmaps (aka 'cm') * controllerrevisions * cronjobs * customresourcedefinition (aka 'crd') * daemonsets (aka 'ds') * deployments (aka 'deploy') * deploymentconfigs (aka 'dc') * endpoints (aka 'ep') * events (aka 'ev') * horizontalpodautoscalers (aka 'hpa') * imagestreamimages (aka 'isimage') * imagestreams (aka 'is') * imagestreamtags (aka 'istag') * ingresses (aka 'ing') * groups * jobs * limitranges (aka 'limits') * namespaces (aka 'ns') * networkpolicies (aka 'netpol') * nodes (aka 'no') * persistentvolumeclaims (aka 'pvc') * persistentvolumes (aka 'pv') * poddisruptionbudgets (aka 'pdb') * podpreset * pods (aka 'po') * podsecuritypolicies (aka 'psp') * podtemplates * projects * replicasets (aka 'rs') * replicationcontrollers (aka 'rc') * resourcequotas (aka 'quota') * rolebindings * roles * routes * secrets * serviceaccounts (aka 'sa') * services (aka 'svc') * statefulsets (aka 'sts') * storageclasses (aka 'sc') * userserror: Required resource not specified. Use "oc explain <resource>" for a detailed description of that resource (e.g. oc explain pods). See 'oc get -h' for help and examples. We can see that the error message "error: Required resource not specified." is in wrong place(together with the last resource *user), that should not happen As a conclusion, since fix PR is merged in 3.9.71 but the output still not satisfying, so I'm assigning back
I don't think we'll fix that, give the newer versions (starting from 3.11) don't print that list. I'm moving the target release to 3.11 in that case.
# oc get You must specify the type of resource to get. Use "oc api-resources" for a complete list of supported resources. error: Required resource not specified. Use "oc explain <resource>" for a detailed description of that resource (e.g. oc explain pods). See 'oc get -h' for help and examples. oc 3.11.90 doesn't print the resource lists, and the ouput is expected, move to VERIFIED # oc version oc v3.11.90 kubernetes v1.11.0+d4cacc0 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://<master> openshift v3.11.88 kubernetes v1.11.0+d4cacc0
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0636