Helpers: Improve extraModules.

- Make `command` a multiline list.
- Fix `toYaml` usage.
- Remove `toYaml` where not necessary.
This commit is contained in:
Marco Ebert 2023-10-04 14:50:49 +02:00
parent ee656538b7
commit 6d4aa813e5

View file

@ -230,18 +230,21 @@ Extra modules.
{{- define "extraModules" -}} {{- define "extraModules" -}}
- name: {{ .name }} - name: {{ .name }}
image: {{ .image }} image: {{ .image }}
{{- if .distroless | default false }} command:
command: ['/init_module'] {{- if .distroless }}
- /init_module
{{- else }} {{- else }}
command: ['sh', '-c', '/usr/local/bin/init_module.sh'] - sh
- -c
- /usr/local/bin/init_module.sh
{{- end }} {{- end }}
{{- if .containerSecurityContext }} {{- if .containerSecurityContext }}
securityContext: {{ .containerSecurityContext | toYaml | nindent 4 }} securityContext: {{ toYaml .containerSecurityContext | nindent 4 }}
{{- end }} {{- end }}
{{- if .resources }} {{- if .resources }}
resources: {{ .resources | toYaml | nindent 4 }} resources: {{ toYaml .resources | nindent 4 }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: {{ toYaml "modules"}} - name: modules
mountPath: {{ toYaml "/modules_mount"}} mountPath: /modules_mount
{{- end -}} {{- end -}}