my-apps/charts/common/templates/lib/pod/_runtimeClassName.tpl
2025-08-24 00:09:37 +03:00

25 lines
757 B
Smarty

{{/* Returns Runtime Class Name */}}
{{/* Call this template:
{{ include "tc.v1.common.lib.pod.runtimeClassName" (dict "rootCtx" $ "objectData" $objectData) }}
rootCtx: The root context of the chart.
objectData: The object data to be used to render the Pod.
*/}}
{{- define "tc.v1.common.lib.pod.runtimeClassName" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- $runtime := "" -}}
{{/* Initialize from the "defaults" */}}
{{- with $rootCtx.Values.podOptions.runtimeClassName -}}
{{- $runtime = tpl . $rootCtx -}}
{{- end -}}
{{/* Override from the pod values, if defined */}}
{{- with $objectData.podSpec.runtimeClassName -}}
{{- $runtime = tpl . $rootCtx -}}
{{- end -}}
{{- $runtime -}}
{{- end -}}