Skip to content

Commit 967f167

Browse files
committed
chore: Split the clusterroles between operator and product
1 parent 9a86c0f commit 967f167

2 files changed

Lines changed: 21 additions & 19 deletions

File tree

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,3 @@ rules:
146146
- get
147147
- list
148148
- patch
149-
---
150-
apiVersion: rbac.authorization.k8s.io/v1
151-
kind: ClusterRole
152-
metadata:
153-
name: {{ include "operator.name" . }}-clusterrole
154-
labels:
155-
{{- include "operator.labels" . | nindent 4 }}
156-
rules:
157-
{{ if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
158-
# Required on OpenShift to allow the Hive pods to run as a non-root user.
159-
- apiGroups:
160-
- security.openshift.io
161-
resources:
162-
- securitycontextconstraints
163-
resourceNames:
164-
- nonroot-v2
165-
verbs:
166-
- use
167-
{{ 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 HiveCluster RoleBinding) to the ServiceAccount that Hive
3+
# workload pods (metastore) 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 Hive 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)