Executing oc adm policy add-cluster-role-to-user cluster-admin user is not adding cluster admin
oc version
oc v3.9.0+191fece
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEG
NAME ROLE USERS GROUPS SERVICE ACCOUNTS SUBJECTS
cluster-admin /cluster-admin system:masters
NAME ROLE USERS GROUPS SERVICE ACCOUNTS SUBJECTS
cluster-admin /cluster-admin gbaufake system:master
I can confirm this bug.
It seems that "oc adm policy add-cluster-role-to-user cluster-admin [user]" creates a new ClusterRole Object for every added user.
My User is in the cluster-admin-0 ClusterRole. The user of my colleague is in cluster-admin-1.
@openshift/sig-security
If you want to add into a specific cluster-role binding then you need to specify it. eg:
oc adm policy add-cluster-role-to-user cluster-admin user --rolebinding-name=cluster-admin
Otherwise a new binding is created, having a different binding name has no functional difference, the user will be a cluster-admin it just uses a separate binding to give the user that role.
@simo5 Thank you for this clarification.
@simo5 thanks!
Change in behavior from 3.7 - and not documented anywhere in release notes
Most helpful comment
If you want to add into a specific cluster-role binding then you need to specify it. eg:
oc adm policy add-cluster-role-to-user cluster-admin user --rolebinding-name=cluster-admin
Otherwise a new binding is created, having a different binding name has no functional difference, the user will be a cluster-admin it just uses a separate binding to give the user that role.