Skip to content

Commit 4c60956

Browse files
committed
chore: Split the roles.yaml into separate files for clusterrole-operator.yaml and clusterrole-product.yaml
Also rename the opa-builder clusterrole file to be consistent
1 parent c80b61c commit 4c60956

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

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

File renamed without changes.

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,3 @@ rules:
112112
- {{ include "operator.name" . }}clusters/status
113113
verbs:
114114
- patch
115-
116-
---
117-
apiVersion: rbac.authorization.k8s.io/v1
118-
kind: ClusterRole
119-
metadata:
120-
name: {{ include "operator.name" . }}-clusterrole
121-
labels:
122-
{{- include "operator.labels" . | nindent 4 }}
123-
rules:
124-
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
125-
# Required on OpenShift to allow the OPA pods to run as a non-root user.
126-
- apiGroups:
127-
- security.openshift.io
128-
resources:
129-
- securitycontextconstraints
130-
resourceNames:
131-
- nonroot-v2
132-
verbs:
133-
- use
134-
{{ 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 OpaCluster RoleBinding) to the ServiceAccount that OPA
3+
# 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 the OPA 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)