Files
library-charts/library/common/templates/lib/container/_command.tpl
Kjeld Schouten-Lebbing da3e2d2de9 Common Refactor
2023-01-16 17:03:31 +01:00

20 lines
607 B
Smarty

{{/*
A custom dict is expected with commands and root.
It's designed to work for mainContainer AND initContainers.
Calling this from an initContainer, wouldn't work, as it would have a different "root" context,
and "tpl" on "$" would cause erors.
That's why the custom dict is expected.
*/}}
{{/* Command included by the container */}}
{{- define "ix.v1.common.container.command" -}}
{{- $commands := .commands -}}
{{- $root := .root -}}
{{- if $commands }}
{{- if kindIs "string" $commands -}}
- {{ tpl $commands $root }}
{{- else }}
{{- tpl (toYaml $commands) $root }}
{{- end }}
{{- end }}
{{- end -}}