Bug 1984904
| Summary: | roleRef.kind for monitoring-alertmanager-edit RoleBinding is wrong | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Junqi Zhao <juzhao> |
| Component: | oc | Assignee: | Filip Krepinsky <fkrepins> |
| Status: | CLOSED NOTABUG | QA Contact: | zhou ying <yinzhou> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 4.9 | CC: | aos-bugs, jokerman, mfojtik |
| 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: | 2021-07-27 09:03:43 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
Junqi Zhao
2021-07-22 12:51:12 UTC
According to the help: $ oc adm policy add-role-to-user -h
Add a role to users or service accounts for the current project
So the -n openshift-monitoring only specifies in which namespace the command should take place (RoleBinding should be created)
The help also specifies that:
When --role-namespace argument is specified as a non-empty value, it MUST match the current
namespace. When role-namespace is specified, the rolebinding will reference a namespaced Role. Otherwise, the
rolebinding will reference a ClusterRole resource.
--role-namespace='': namespace where the role is located: empty means a role defined in cluster policy
I have tested it and after adding this argument appropriate RoleBinding referencing role was created.
Can you check if the following command works on your side as well?
oc adm policy add-role-to-user monitoring-alertmanager-edit testuser-11 -n openshift-monitoring --role-namespace openshift-monitoring
(In reply to Filip Krepinsky from comment #1) > Can you check if the following command works on your side as well? > > oc adm policy add-role-to-user monitoring-alertmanager-edit testuser-11 -n > openshift-monitoring --role-namespace openshift-monitoring no issue for above command # oc -n openshift-monitoring get RoleBinding monitoring-alertmanager-edit -oyaml apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: creationTimestamp: "2021-07-27T06:28:38Z" name: monitoring-alertmanager-edit namespace: openshift-monitoring resourceVersion: "202850" uid: 7afdc5d2-72db-4679-803b-018493a77740 roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: monitoring-alertmanager-edit subjects: - apiGroup: rbac.authorization.k8s.io kind: User name: testuser-11 Ok, in that case I am closing the bug. Please open a RFE if you think current behaviour could be improved. |