Skip to content

Commit 02af321

Browse files
committed
chore: Split the roles.yaml into separate files for clusterrole-operator.yaml and clusterrole-product.yaml
1 parent 6479f5b commit 02af321

2 files changed

Lines changed: 22 additions & 19 deletions

File tree

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: rbac.authorization.k8s.io/v1
23
kind: ClusterRole
34
metadata:
@@ -128,22 +129,3 @@ rules:
128129
- {{ include "operator.name" . }}clusters/status
129130
verbs:
130131
- patch
131-
---
132-
apiVersion: rbac.authorization.k8s.io/v1
133-
kind: ClusterRole
134-
metadata:
135-
name: {{ include "operator.name" . }}-clusterrole
136-
labels:
137-
{{- include "operator.labels" . | nindent 4 }}
138-
rules:
139-
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
140-
# Required on OpenShift to allow the OpenSearch pods to run as a non-root user.
141-
- apiGroups:
142-
- security.openshift.io
143-
resources:
144-
- securitycontextconstraints
145-
resourceNames:
146-
- nonroot-v2
147-
verbs:
148-
- use
149-
{{ 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 OpenSearchCluster RoleBinding) to the ServiceAccount that
3+
# OpenSearch 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 OpenSearch 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)