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

19 lines
572 B
Smarty

{{/*
Image used by the container.
*/}}
{{- define "bjw-s.common.lib.container.field.image" -}}
{{- $ctx := .ctx -}}
{{- $rootContext := $ctx.rootContext -}}
{{- $containerObject := $ctx.containerObject -}}
{{- $imageRepo := $containerObject.image.repository -}}
{{- $imageTag := default $rootContext.Chart.AppVersion $containerObject.image.tag -}}
{{- if kindIs "float64" $imageTag -}}
{{- $imageTag = $imageTag | toString -}}
{{- end -}}
{{- if and $imageRepo $imageTag -}}
{{- printf "%s:%s" $imageRepo $imageTag -}}
{{- end -}}
{{- end -}}