Bug 1425398
| Summary: | [Auth] Issues for option -z supported for long service account name in the oc policy command | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Chuan Yu <chuyu> |
| Component: | oc | Assignee: | Maciej Szulik <maszulik> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Xingxing Xia <xxia> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.5.0 | CC: | aos-bugs, jokerman, mmccomas, pweil |
| Target Milestone: | --- | ||
| Target Release: | 3.7.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause:
Service Account names where not properly validated.
Consequence:
Command was failing when invoked with long SA name.
Fix:
Properly validate long SA names.
Result:
oc policy command is returning error when using long SA name.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-11-21 18:38:08 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: | |
| Embargoed: | |||
|
Description
Chuan Yu
2017-02-21 10:40:10 UTC
IMHO this is not a bug. Per the docs: -z, --serviceaccount=[]: service account in the current namespace to use as a user Thus -z always refers to SAs in the current namespace. Therefore specifying the long name is invalid as that is just a construct used to refer to arbitrary SAs from cluster scope. Agreed that -z is meant to be for the service account in the current namespace as per the doc and is not meant to accept the long form or reference a non-current namespace. If the -z not accept the long form naming, then the command should raise error when use it. Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/d70ebd6f21d8e601ebaa6111842e76d47d248903 return error on long-form or invalid sa name bug: 1425398 Returns an error when the long-form name of a ServiceAccount is used with the --serviceaccount (-z) flag in `oc policy ...' commands, or if the name given is invalid. Verified. # openshift version openshift v3.7.0-0.190.0 kubernetes v1.7.6+a08f5eeb62 etcd 3.2.8 |