Skip to content

Commit

Permalink
Merge pull request #2151 from facchettos/webhook-eso
Browse files Browse the repository at this point in the history
added clusterrole rule for eso and webhook
  • Loading branch information
FabianKramm authored Sep 18, 2024
2 parents 84d0a89 + 195f0f7 commit 61b790e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chart/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ rules:
resources: ["nodes"]
verbs: ["get", "list"]
{{- end }}
{{- if and .Values.integrations.kubeVirt.enabled .Values.integrations.kubeVirt.webhook.enabled }}
{{- if or (and .Values.integrations.kubeVirt.enabled .Values.integrations.kubeVirt.webhook.enabled) (and .Values.integrations.externalSecrets.enabled .Values.integrations.externalSecrets.webhook.enabled ) }}
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"]
verbs: ["get", "list", "watch"]
Expand Down
12 changes: 11 additions & 1 deletion chart/tests/clusterrole_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ tests:
integrations:
externalSecrets:
enabled: true
webhook:
enabled: false
release:
name: my-release
namespace: my-namespace
Expand Down Expand Up @@ -400,6 +402,8 @@ tests:
integrations:
externalSecrets:
enabled: true
webhook:
enabled: true
sync:
clusterStores:
enabled: true
Expand All @@ -409,9 +413,15 @@ tests:
asserts:
- hasDocuments:
count: 1
- contains:
path: rules
content:
apiGroups: ["admissionregistration.k8s.io"]
resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"]
verbs: ["get", "list", "watch"]
- contains:
path: rules
content:
apiGroups: [ "external-secrets.io" ]
resources: [ "clustersecretstores" ]
verbs: [ "get", "list", "watch" ]
verbs: ["get", "list", "watch"]

0 comments on commit 61b790e

Please sign in to comment.