Skip to content

Commit 9541b62

Browse files
authored
Merge pull request #785 from lakrass/main
feat(helm): added flag to enable mutations in deployment namespace
2 parents 834d646 + 227db93 commit 9541b62

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

deploy/charts/vault-secrets-webhook/templates/apiservice-webhook.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,12 @@ webhooks:
175175
{{- if $podsNamespaceSelector.matchExpressions }}
176176
{{ toYaml $podsNamespaceSelector.matchExpressions | indent 4 }}
177177
{{- end }}
178+
{{- if .Values.ignoreReleaseNamespace }}
178179
- key: kubernetes.io/metadata.name
179180
operator: NotIn
180181
values:
181182
- {{ .Release.Namespace }}
183+
{{- end }}
182184
{{- if semverCompare ">=1.15-0" (include "vault-secrets-webhook.capabilities.kubeVersion" .) }}
183185
objectSelector:
184186
{{- if $podsObjectSelector.matchLabels }}
@@ -243,10 +245,12 @@ webhooks:
243245
{{- if $secretsNamespaceSelector.matchExpressions }}
244246
{{ toYaml $secretsNamespaceSelector.matchExpressions | indent 4 }}
245247
{{- end }}
248+
{{- if .Values.ignoreReleaseNamespace }}
246249
- key: kubernetes.io/metadata.name
247250
operator: NotIn
248251
values:
249252
- {{ .Release.Namespace }}
253+
{{- end }}
250254
{{- if semverCompare ">=1.15-0" (include "vault-secrets-webhook.capabilities.kubeVersion" .) }}
251255
objectSelector:
252256
{{- if $secretsObjectSelector.matchLabels }}
@@ -316,10 +320,12 @@ webhooks:
316320
{{- if $configmapsNamespaceSelector.matchExpressions }}
317321
{{ toYaml $configmapsNamespaceSelector.matchExpressions | indent 4 }}
318322
{{- end }}
323+
{{- if .Values.ignoreReleaseNamespace }}
319324
- key: kubernetes.io/metadata.name
320325
operator: NotIn
321326
values:
322327
- {{ .Release.Namespace }}
328+
{{- end }}
323329
{{- if semverCompare ">=1.15-0" (include "vault-secrets-webhook.capabilities.kubeVersion" .) }}
324330
objectSelector:
325331
{{- if $configmapsObjectSelector.matchLabels }}
@@ -386,10 +392,12 @@ webhooks:
386392
{{- if $crNamespaceSelector.matchExpressions }}
387393
{{ toYaml $crNamespaceSelector.matchExpressions | indent 4 }}
388394
{{- end }}
395+
{{- if .Values.ignoreReleaseNamespace }}
389396
- key: kubernetes.io/metadata.name
390397
operator: NotIn
391398
values:
392399
- {{ .Release.Namespace }}
400+
{{- end }}
393401
{{- if semverCompare ">=1.15-0" (include "vault-secrets-webhook.capabilities.kubeVersion" .) }}
394402
objectSelector:
395403
{{- if $crObjectSelector.matchLabels }}

deploy/charts/vault-secrets-webhook/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ secretsFailurePolicy: Ignore
236236
# Check: <https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#side-effects>
237237
apiSideEffectValue: NoneOnDryRun
238238

239+
# -- Enables the webhook to ignore resources in the namespace it is deployed to.
240+
# Set to `false` to enable mutations within the namespace the webhook runs in.
241+
ignoreReleaseNamespace: true
242+
239243
# -- Namespace selector to use, will limit webhook scope (K8s version 1.15+)
240244
namespaceSelector:
241245
# @ignored

0 commit comments

Comments
 (0)