1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

fix: add custom labels support back in helm chart ()

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-03-16 16:52:59 +01:00 committed by GitHub
parent ad3bf969bf
commit 2270da0597
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions
charts/kyverno/templates/_helpers

View file

@ -3,7 +3,7 @@
{{- define "kyverno.image" -}}
{{- $tag := default .defaultTag .image.tag -}}
{{- if not (typeIs "string" $tag) -}}
{{ fail "Image tags must be strings." }}
{{ fail "Image tags must be strings." }}
{{- end -}}
{{- if .image.registry -}}
{{- print .image.registry "/" (required "An image repository is required" .image.repository) ":" $tag -}}

View file

@ -3,10 +3,10 @@
{{- define "kyverno.labels.merge" -}}
{{- $labels := dict -}}
{{- range . -}}
{{- $labels = merge $labels (fromYaml .) -}}
{{- $labels = merge $labels (fromYaml .) -}}
{{- end -}}
{{- with $labels -}}
{{- toYaml $labels -}}
{{- toYaml $labels -}}
{{- end -}}
{{- end -}}
@ -22,7 +22,11 @@ app.kubernetes.io/version: {{ template "kyverno.chartVersion" . }}
{{- end -}}
{{- define "kyverno.labels.common" -}}
{{- template "kyverno.labels.merge" (list (include "kyverno.labels.helm" .) (include "kyverno.labels.version" .)) -}}
{{- template "kyverno.labels.merge" (list
(include "kyverno.labels.helm" .)
(include "kyverno.labels.version" .)
(toYaml .Values.customLabels)
) -}}
{{- end -}}
{{- define "kyverno.matchLabels.common" -}}

View file

@ -10,7 +10,7 @@ policy/v1beta1
{{- define "kyverno.pdb.spec" -}}
{{- if and .minAvailable .maxUnavailable -}}
{{- fail "Cannot set both .minAvailable and .maxUnavailable" -}}
{{- fail "Cannot set both .minAvailable and .maxUnavailable" -}}
{{- end -}}
{{- if not .maxUnavailable }}
minAvailable: {{ default 1 .minAvailable }}