helm-charts/charts/library/common/templates/lib/container/_valuesToObject.tpl
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 66389dec8b
feat(common): Release 2.0.1 (#193)
2023-10-03 09:24:41 +02:00

21 lines
665 B
Smarty

{{/*
Convert container values to an object
*/}}
{{- define "bjw-s.common.lib.container.valuesToObject" -}}
{{- $rootContext := .rootContext -}}
{{- $identifier := .id -}}
{{- $objectValues := .values -}}
{{- $_ := set $objectValues "identifier" $identifier -}}
{{- /* Convert float64 image tags to string */ -}}
{{- if kindIs "map" $objectValues.image -}}
{{- $imageTag := dig "image" "tag" "" $objectValues -}}
{{- if kindIs "float64" $imageTag -}}
{{- $_ := set $objectValues.image "tag" ($imageTag | toString) -}}
{{- end -}}
{{- end -}}
{{- /* Return the container object */ -}}
{{- $objectValues | toYaml -}}
{{- end -}}