From 519197b511d862979ff9f5ca3e7732bb646c780b Mon Sep 17 00:00:00 2001 From: ChrisDevo Date: Sat, 11 Mar 2023 14:45:45 -0800 Subject: [PATCH] Improve parsing of helm global.logLevel (only accept integers 0-5, inclusive) Signed-off-by: ChrisDevo --- deploy/charts/cert-manager/templates/cainjector-deployment.yaml | 2 +- deploy/charts/cert-manager/templates/deployment.yaml | 2 +- deploy/charts/cert-manager/templates/webhook-deployment.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/charts/cert-manager/templates/cainjector-deployment.yaml b/deploy/charts/cert-manager/templates/cainjector-deployment.yaml index e6f2aea32..c0f65c03a 100644 --- a/deploy/charts/cert-manager/templates/cainjector-deployment.yaml +++ b/deploy/charts/cert-manager/templates/cainjector-deployment.yaml @@ -58,7 +58,7 @@ spec: image: "{{ template "image" (tuple .Values.cainjector.image $.Chart.AppVersion) }}" imagePullPolicy: {{ .Values.cainjector.image.pullPolicy }} args: - {{- if .Values.global.logLevel }} + {{- if eq (.Values.global.logLevel | toString) "0" "1" "2" "3" "4" "5" }} - --v={{ .Values.global.logLevel }} {{- end }} {{- with .Values.global.leaderElection }} diff --git a/deploy/charts/cert-manager/templates/deployment.yaml b/deploy/charts/cert-manager/templates/deployment.yaml index dfc226768..921a4c655 100644 --- a/deploy/charts/cert-manager/templates/deployment.yaml +++ b/deploy/charts/cert-manager/templates/deployment.yaml @@ -76,7 +76,7 @@ spec: image: "{{ template "image" (tuple .Values.image $.Chart.AppVersion) }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - {{- if .Values.global.logLevel }} + {{- if eq (.Values.global.logLevel | toString) "0" "1" "2" "3" "4" "5" }} - --v={{ .Values.global.logLevel }} {{- end }} {{- if .Values.config }} diff --git a/deploy/charts/cert-manager/templates/webhook-deployment.yaml b/deploy/charts/cert-manager/templates/webhook-deployment.yaml index ec640700f..f53a169d8 100644 --- a/deploy/charts/cert-manager/templates/webhook-deployment.yaml +++ b/deploy/charts/cert-manager/templates/webhook-deployment.yaml @@ -63,7 +63,7 @@ spec: image: "{{ template "image" (tuple .Values.webhook.image $.Chart.AppVersion) }}" imagePullPolicy: {{ .Values.webhook.image.pullPolicy }} args: - {{- if .Values.global.logLevel }} + {{- if eq (.Values.global.logLevel | toString) "0" "1" "2" "3" "4" "5" }} - --v={{ .Values.global.logLevel }} {{- end }} {{- if .Values.webhook.config }}