Skip to content

Commit 17d2974

Browse files
committed
chore: Split the roles.yaml into separate files for clusterrole-operator.yaml and clusterrole-product.yaml
1 parent 27927f5 commit 17d2974

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,3 @@ rules:
133133
- list
134134
- patch
135135
- watch
136-
---
137-
# Product ClusterRole: bound (via per KafkaCluster RoleBinding) to the ServiceAccount that Kafka
138-
# workload pods (brokers, KRaft controllers) run as.
139-
apiVersion: rbac.authorization.k8s.io/v1
140-
kind: ClusterRole
141-
metadata:
142-
name: {{ include "operator.name" . }}-clusterrole
143-
labels:
144-
{{- include "operator.labels" . | nindent 4 }}
145-
rules:
146-
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
147-
# On OpenShift, the workload pods must be allowed to use the nonroot-v2 SCC
148-
- apiGroups:
149-
- security.openshift.io
150-
resources:
151-
- securitycontextconstraints
152-
resourceNames:
153-
- nonroot-v2
154-
verbs:
155-
- use
156-
{{ 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 KafkaCluster RoleBinding) to the ServiceAccount that Kafka
3+
# workload pods (brokers, KRaft controllers) 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+
# On OpenShift, the workload pods must be allowed to use the nonroot-v2 SCC
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)