k8s/helm-charts/dashy/charts/common/templates/lib/pod/_hostname.tpl.tpl
root 1eaf295724
Some checks failed
continuous-integration/drone/push Build is failing
new way of doin
2023-11-16 19:42:02 +10:00

23 lines
643 B
Smarty

{{/* Returns Host Name */}}
{{/* Call this template:
{{ include "tc.v1.common.lib.pod.hostname" (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.hostname" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- $hostname := "" -}}
{{- with $objectData.podSpec.hostname -}}
{{- $hostname = tpl . $rootCtx -}}
{{- end -}}
{{- if $hostname -}}
{{- include "tc.v1.common.lib.chart.names.validation" (dict "name" $hostname) -}}
{{- end -}}
{{- $hostname -}}
{{- end -}}