| Summary: | [userinterface_public_711] Message from oadm with --request-timeout needs not the info of help cmd | ||
|---|---|---|---|
| Product: | OKD | Reporter: | Xingxing Xia <xxia> |
| Component: | oc | Assignee: | Juan Vallejo <jvallejo> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Xingxing Xia <xxia> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 3.x | CC: | aos-bugs, mmccomas |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-11-10 21:34:11 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Xingxing Xia
2016-10-21 10:08:54 UTC
The reason why you are seeing this additional error (See 'oadm ... -h' ...) after _some_ `oadm` sub-commands is because they pass any errors they receive through CheckErr(UsageErr(err)) https://github.com/openshift/origin/blob/master/pkg/cmd/admin/policy/modify_roles.go#L137 This is not limited to just `oadm` commands, several `oc` commands such as `oc policy` do this as well: ``` $ oc policy can-i list pods --request-timeout=1ms error: Get https://10.13.137.149:8443/api: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) See 'oc policy can-i -h' for help and examples. ``` A solution to this would be to type the request timeout error, go through every sub-command in the command tree that returns a `UsageError` on failure, and update it so that the `UsageError` is returned in each of its helper functions instead (but only if the error is not of the new request timeout error type), rather than having the UsageError return in the command's `Run` function. I am not sure how feasible this would be. At least as of v3.7, executing the command from comment 0 [1] no longer displays help info: [1] ``` $ oadm policy remove-role-from-user admin star --request-timeout=1ms Unable to connect to the server: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) ``` Indeed in v3.7 (oadm v3.7.0-0.181.0) the unrelated "See 'oadm ... -h' for help and examples" is not shown. (oadm v3.6.173.0.56 still shows) |