@@ -15,32 +15,8 @@ To prevent access to a particular build strategy globally, log in as a user with
15
15
+
16
16
[source,terminal]
17
17
----
18
- $ oc edit clusterrolebinding system:build-strategy-docker-binding
18
+ $ oc annotate clusterrolebinding.rbac system:build-strategy-docker-binding 'rbac.authorization.kubernetes.io/autoupdate=false' -- overwrite
19
19
----
20
- +
21
- .Example output
22
- [source,yaml]
23
- ----
24
- apiVersion: rbac.authorization.k8s.io/v1
25
- kind: ClusterRoleBinding
26
- metadata:
27
- annotations:
28
- rbac.authorization.kubernetes.io/autoupdate: "false" <1>
29
- creationTimestamp: 2018-08-10T01:24:14Z
30
- name: system:build-strategy-docker-binding
31
- resourceVersion: "225"
32
- selfLink: /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/system%3Abuild-strategy-docker-binding
33
- uid: 17b1f3d4-9c3c-11e8-be62-0800277d20bf
34
- roleRef:
35
- apiGroup: rbac.authorization.k8s.io
36
- kind: ClusterRole
37
- name: system:build-strategy-docker
38
- subjects:
39
- - apiGroup: rbac.authorization.k8s.io
40
- kind: Group
41
- name: system:authenticated
42
- ----
43
- <1> Change the `rbac.authorization.kubernetes.io/autoupdate` annotation's value to `"false"` .
44
20
45
21
. Remove the role by entering the following command:
46
22
+
@@ -49,45 +25,14 @@ subjects:
49
25
$ oc adm policy remove-cluster-role-from-group system:build-strategy-docker system:authenticated
50
26
----
51
27
52
- . Ensure the build strategy subresources are also removed from these roles:
28
+ . Ensure the build strategy subresources are also removed from the `admin` and `edit` user roles:
53
29
+
54
30
[source,terminal]
55
31
----
56
- $ oc edit clusterrole admin
32
+ $ oc get clusterrole admin -o yaml | grep "builds/docker"
57
33
----
58
34
+
59
35
[source,terminal]
60
36
----
61
- $ oc edit clusterrole edit
62
- ----
63
-
64
- . For each role, specify the subresources that correspond to the resource of the strategy to disable.
65
-
66
- .. Disable the docker Build Strategy for *admin*:
67
- +
68
- [source,yaml]
69
- ----
70
- kind: ClusterRole
71
- metadata:
72
- name: admin
73
- ...
74
- - apiGroups:
75
- - ""
76
- - build.openshift.io
77
- resources:
78
- - buildconfigs
79
- - buildconfigs/webhooks
80
- - builds/custom <1>
81
- - builds/source
82
- verbs:
83
- - create
84
- - delete
85
- - deletecollection
86
- - get
87
- - list
88
- - patch
89
- - update
90
- - watch
91
- ...
37
+ $ oc get clusterrole edit -o yaml | grep "builds/docker"
92
38
----
93
- <1> Add `builds/custom` and `builds/source` to disable docker builds globally for users with the *admin* role.
0 commit comments