Bug 1778019
Summary: | Usage info is being printed on all errors | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Xingxing Xia <xxia> |
Component: | oc | Assignee: | Sally <somalley> |
Status: | CLOSED ERRATA | QA Contact: | zhou ying <yinzhou> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.3.0 | CC: | aos-bugs, jokerman, mfojtik |
Target Milestone: | --- | ||
Target Release: | 4.4.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1748777 | Environment: | |
Last Closed: | 2020-05-04 11:17:52 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Xingxing Xia
2019-11-29 03:06:46 UTC
Sally can you check this, since you worked on https://bugzilla.redhat.com/show_bug.cgi?id=1748777 Moving this to 4.4, since it's a low priority item. For the 'oc run -lll' example, the output is expected, because the '-i' or '--image=' flag is required to run the command. You passed 'oc run -lll' and that is actually a valid flag '-l=ll' or '--labels=ll', so you'll get the error for 'although a valid flag was passed, you did not give the required "image" flag. I think returning usage in this case makes sense. For 'oc patch' the output is also expected, that the '-p' or '--patch=' flag must be set. You passed 'oc patch type/name' but did not pass the "patch" flag like 'oc patch kubeapiserver/cluster -p blah'. Since a 'bad flag' was not given, you still get the usage menu. Again, I think returning usage makes sense here. After discussing with team, we'll want to only return the suggestion to run help, instead of the full menu. I'll open a PR to this effect shortly. upstream PR here: https://github.com/kubernetes/kubernetes/pull/86693 Confirmed with latest oc client, can't reproduce the issue now: oc version: 4.4.0-202001081744.git.1.1aae263.el7 [root@dhcp-140-138 ~]# oc run -lll Error: required flag(s) "image" not set [root@dhcp-140-138 ~]# oc run -aa Error: unknown shorthand flag: 'a' in -aa See 'oc run --help' for usage. 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-2020:0581 |