_envList.tpl 984 B

1234567891011121314151617181920212223
  1. {{/* Returns Env List */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.container.envList" (dict "rootCtx" $ "objectData" $objectData) }}
  4. rootCtx: The root context of the chart.
  5. objectData: The object data to be used to render the container.
  6. */}}
  7. {{- define "ix.v1.common.lib.container.envList" -}}
  8. {{- $rootCtx := .rootCtx -}}
  9. {{- $objectData := .objectData -}}
  10. {{- range $env := $objectData.envList -}}
  11. {{- if not $env.name -}}
  12. {{- fail "Container - Expected non-empty <envList.name>" -}}
  13. {{- end -}} {{/* Empty value is valid */}}
  14. {{- include "ix.v1.common.helper.container.envDupeCheck" (dict "rootCtx" $rootCtx "objectData" $objectData "source" "envList" "key" $env.name) -}}
  15. {{- $value := $env.value -}}
  16. {{- if kindIs "string" $env.value -}}
  17. {{- $value = tpl $env.value $rootCtx -}}
  18. {{- end }}
  19. - name: {{ $env.name | quote }}
  20. value: {{ include "ix.v1.common.helper.makeIntOrNoop" $value | quote }}
  21. {{- end -}}
  22. {{- end -}}