helm-charts/charts/library/common/templates/lib/container/fields/_name.tpl
2023-09-13 11:24:23 +02:00

24 lines
675 B
Smarty

{{/*
Name used by the container.
*/}}
{{- define "bjw-s.common.lib.container.field.name" -}}
{{- $ctx := .ctx -}}
{{- $rootContext := $ctx.rootContext -}}
{{- $containerObject := $ctx.containerObject -}}
{{- /* Default to container identifier */ -}}
{{- $name := $containerObject.identifier -}}
{{- /* See if an override is desired */ -}}
{{- if hasKey $containerObject "nameOverride" -}}
{{- $option := get $containerObject "nameOverride" -}}
{{- if not (empty $option) -}}
{{- $name = $option -}}
{{- end -}}
{{- end -}}
{{- /* Parse any templates */ -}}
{{- $name = tpl $name $rootContext -}}
{{- $name | toYaml -}}
{{- end -}}