File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
2
2
{{/* This cluster role and binding is necessary to allow the operator to automatically register ValidatingWebhookConfiguration. */}}
3
3
{{- if and .Values.operator.webhook.registerConfiguration .Values.operator.webhook.installClusterRole }}
4
- {{- if not (lookup "rbac.authorization.k8s.io/v1" "ClusterRole" "" "mongodb-kubernetes-operator-mongodb-webhook") }}
4
+ {{- $webhookClusterRoleName := printf "%s-%s-webhook" .Values.operator.name (include "mongodb-kubernetes-operator.namespace" .) }}
5
+ {{- if not (lookup "rbac.authorization.k8s.io/v1" "ClusterRole" "" $webhookClusterRoleName) }}
5
6
---
6
7
kind : ClusterRole
7
8
apiVersion : rbac.authorization.k8s.io/v1
8
9
metadata :
9
- name : {{.Values.operator.baseName}}-operator-mongodb-webhook
10
+ name : {{ $webhookClusterRoleName }}
10
11
rules :
11
12
- apiGroups :
12
13
- " admissionregistration.k8s.io"
@@ -38,7 +39,7 @@ metadata:
38
39
roleRef :
39
40
apiGroup : rbac.authorization.k8s.io
40
41
kind : ClusterRole
41
- name : {{.Values.operator.baseName}}-operator-mongodb-webhook
42
+ name : {{ $webhookClusterRoleName }}
42
43
subjects :
43
44
- kind : ServiceAccount
44
45
name : {{ .Values.operator.name }}
You can’t perform that action at this time.
0 commit comments