Files
chart/library/common/templates/lib/container/_envList.tpl
Stavros Kois 087d5be7cc NAS-122681 / 23.10 / Handle longer ints in few places that might have one (#1358)
* Handle longer ints in few places that might have one

* add tests

* add note

* Add some more checking
2023-07-15 23:14:46 +03:00

24 lines
984 B
Smarty

{{/* Returns Env List */}}
{{/* Call this template:
{{ include "ix.v1.common.lib.container.envList" (dict "rootCtx" $ "objectData" $objectData) }}
rootCtx: The root context of the chart.
objectData: The object data to be used to render the container.
*/}}
{{- define "ix.v1.common.lib.container.envList" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- range $env := $objectData.envList -}}
{{- if not $env.name -}}
{{- fail "Container - Expected non-empty <envList.name>" -}}
{{- end -}} {{/* Empty value is valid */}}
{{- include "ix.v1.common.helper.container.envDupeCheck" (dict "rootCtx" $rootCtx "objectData" $objectData "source" "envList" "key" $env.name) -}}
{{- $value := $env.value -}}
{{- if kindIs "string" $env.value -}}
{{- $value = tpl $env.value $rootCtx -}}
{{- end }}
- name: {{ $env.name | quote }}
value: {{ include "ix.v1.common.helper.makeIntOrNoop" $value | quote }}
{{- end -}}
{{- end -}}