Skip to content

Commit a6326be

Browse files
authored
Merge pull request #82186 from adambkaplan/ocpbugs-42217-fix-disable-buildconfig-strategy
OCPBUGS-42217: Correcting Instructions to Disable Build Strategy
2 parents b2f73d6 + 13c6634 commit a6326be

File tree

1 file changed

+4
-59
lines changed

1 file changed

+4
-59
lines changed

modules/builds-disabling-build-strategy-globally.adoc

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,8 @@ To prevent access to a particular build strategy globally, log in as a user with
1515
+
1616
[source,terminal]
1717
----
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
1919
----
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"`.
4420

4521
. Remove the role by entering the following command:
4622
+
@@ -49,45 +25,14 @@ subjects:
4925
$ oc adm policy remove-cluster-role-from-group system:build-strategy-docker system:authenticated
5026
----
5127

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:
5329
+
5430
[source,terminal]
5531
----
56-
$ oc edit clusterrole admin
32+
$ oc get clusterrole admin -o yaml | grep "builds/docker"
5733
----
5834
+
5935
[source,terminal]
6036
----
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"
9238
----
93-
<1> Add `builds/custom` and `builds/source` to disable docker builds globally for users with the *admin* role.

0 commit comments

Comments
 (0)