From 6d4aa813e558b59097ab549a6e33e49865f5fc03 Mon Sep 17 00:00:00 2001 From: Marco Ebert Date: Wed, 4 Oct 2023 14:50:49 +0200 Subject: [PATCH] Helpers: Improve `extraModules`. - Make `command` a multiline list. - Fix `toYaml` usage. - Remove `toYaml` where not necessary. --- charts/ingress-nginx/templates/_helpers.tpl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/charts/ingress-nginx/templates/_helpers.tpl b/charts/ingress-nginx/templates/_helpers.tpl index b572ff960..771eea6b7 100644 --- a/charts/ingress-nginx/templates/_helpers.tpl +++ b/charts/ingress-nginx/templates/_helpers.tpl @@ -230,18 +230,21 @@ Extra modules. {{- define "extraModules" -}} - name: {{ .name }} image: {{ .image }} - {{- if .distroless | default false }} - command: ['/init_module'] + command: + {{- if .distroless }} + - /init_module {{- else }} - command: ['sh', '-c', '/usr/local/bin/init_module.sh'] + - sh + - -c + - /usr/local/bin/init_module.sh {{- end }} {{- if .containerSecurityContext }} - securityContext: {{ .containerSecurityContext | toYaml | nindent 4 }} + securityContext: {{ toYaml .containerSecurityContext | nindent 4 }} {{- end }} {{- if .resources }} - resources: {{ .resources | toYaml | nindent 4 }} + resources: {{ toYaml .resources | nindent 4 }} {{- end }} volumeMounts: - - name: {{ toYaml "modules"}} - mountPath: {{ toYaml "/modules_mount"}} + - name: modules + mountPath: /modules_mount {{- end -}}