mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
25 lines
779 B
Smarty
25 lines
779 B
Smarty
{{- /*
|
|
Returns the value for dnsPolicy
|
|
*/ -}}
|
|
{{- define "bjw-s.common.lib.pod.field.dnsPolicy" -}}
|
|
{{- $ctx := .ctx -}}
|
|
{{- $controllerObject := $ctx.controllerObject -}}
|
|
|
|
{{- /* Default to "ClusterFirst" */ -}}
|
|
{{- $dnsPolicy := "ClusterFirst" -}}
|
|
|
|
{{- /* Get hostNetwork value "" */ -}}
|
|
{{- $hostNetwork:= include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "hostNetwork") -}}
|
|
{{- if (eq $hostNetwork "true") -}}
|
|
{{- $dnsPolicy = "ClusterFirstWithHostNet" -}}
|
|
{{- end -}}
|
|
|
|
{{- /* See if an override is desired */ -}}
|
|
{{- $override := include "bjw-s.common.lib.pod.getOption" (dict "ctx" $ctx "option" "dnsPolicy") -}}
|
|
|
|
{{- if not (empty $override) -}}
|
|
{{- $dnsPolicy = $override -}}
|
|
{{- end -}}
|
|
|
|
{{- $dnsPolicy -}}
|
|
{{- end -}}
|