You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch adds affirmative output to commands that modify cluster and
local roles for users and groups.
**Examples**
```
$ oadm policy remove-cluster-role-from-group self-provisioner
system:authenticated:oauth system:authenticated
Successfully removed the "self-provisioner" cluster role from groups
["system:authenticated:oauth" "system:authenticated"].
$ oadm policy add-cluster-role-to-group self-provisioner
system:authenticated:oauth
Successfully added the "self-provisioner" cluster role to group
"system:authenticated:oauth".
$ oc policy add-role-to-user cluster-admin testuser
Successfully added the "cluster-admin" role to user "testuser".
$ oc policy remove-role-from-user cluster-admin testuser
Successfully removed the "cluster-admin" role from user "testuser".
```
os::cmd::expect_success_and_text'oc policy add-role-to-group cluster-admin system:unauthenticated''Successfully added the "cluster-admin" role to group "system:unauthenticated"'
34
+
os::cmd::expect_success_and_text'oc policy add-role-to-user cluster-admin system:no-user''Successfully added the "cluster-admin" role to user "system:no-user"'
35
35
os::cmd::expect_success 'oc get rolebinding/cluster-admin --no-headers'
36
36
os::cmd::expect_success_and_text 'oc get rolebinding/cluster-admin --no-headers''system:no-user'
os::cmd::expect_success_and_text'oc policy remove-role-from-group cluster-admin system:unauthenticated''Successfully removed the "cluster-admin" role from group "system:unauthenticated"'
os::cmd::expect_success_and_text'oc policy remove-role-from-user cluster-admin system:no-user''Successfully removed the "cluster-admin" role from user "system:no-user"'
46
+
os::cmd::expect_success_and_text'oc policy remove-role-from-user cluster-admin -z=one,two --serviceaccount=three,four''Successfully removed the "cluster-admin" role from users \["one" "two" "three" "four"\]'
47
47
os::cmd::expect_success 'oc get rolebinding/cluster-admin --no-headers'
48
48
os::cmd::expect_success_and_not_text 'oc get rolebinding/cluster-admin --no-headers''four'
os::cmd::expect_success_and_text'oadm policy remove-cluster-role-from-group system:build-strategy-docker system:authenticated''Successfully removed the "system:build-strategy-docker" cluster role from group "system:authenticated"'
66
+
os::cmd::expect_success_and_text'oadm policy remove-cluster-role-from-group system:build-strategy-source system:authenticated''Successfully removed the "system:build-strategy-source" cluster role from group "system:authenticated"'
67
+
os::cmd::expect_success_and_text'oadm policy remove-cluster-role-from-group system:build-strategy-jenkinspipeline system:authenticated''Successfully removed the "system:build-strategy-jenkinspipeline" cluster role from group "system:authenticated"'
68
68
# ensure build strategy permissions no longer exist
os::cmd::expect_success_and_text'oadm policy add-cluster-role-to-group system:build-strategy-custom system:authenticated''Successfully added the "system:build-strategy-custom" cluster role to group "system:authenticated"'
0 commit comments