Skip to content

Commit fc97b3c

Browse files
committed
chore: Split the roles.yaml into separate files for clusterrole-operator.yaml and clusterrole-product.yaml
1 parent e892700 commit fc97b3c

2 files changed

Lines changed: 21 additions & 19 deletions

File tree

deploy/helm/zookeeper-operator/templates/roles.yaml renamed to deploy/helm/zookeeper-operator/templates/clusterrole-operator.yaml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,3 @@ rules:
158158
- {{ include "operator.name" . }}znodes/status
159159
verbs:
160160
- patch
161-
---
162-
apiVersion: rbac.authorization.k8s.io/v1
163-
kind: ClusterRole
164-
metadata:
165-
name: {{ include "operator.name" . }}-clusterrole
166-
labels:
167-
{{- include "operator.labels" . | nindent 4 }}
168-
rules:
169-
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
170-
# Required on OpenShift to allow ZooKeeper pods to run as a non-root user.
171-
- apiGroups:
172-
- security.openshift.io
173-
resources:
174-
- securitycontextconstraints
175-
resourceNames:
176-
- nonroot-v2
177-
verbs:
178-
- use
179-
{{ end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Product ClusterRole: bound (via per ZookeeperCluster RoleBinding) to the ServiceAccount that
3+
# ZooKeeper workload pods run as.
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: ClusterRole
6+
metadata:
7+
name: {{ include "operator.name" . }}-clusterrole
8+
labels:
9+
{{- include "operator.labels" . | nindent 4 }}
10+
rules:
11+
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
12+
# Required on OpenShift to allow ZooKeeper pods to run as a non-root user.
13+
- apiGroups:
14+
- security.openshift.io
15+
resources:
16+
- securitycontextconstraints
17+
resourceNames:
18+
- nonroot-v2
19+
verbs:
20+
- use
21+
{{ end }}

0 commit comments

Comments
 (0)