mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
19 lines
572 B
Smarty
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 -}}
|