Skip to content

Commit 8d5b605

Browse files
committed
Updated default value to be that of default in k8s, ClusterFirst - also added checks so if policy is None one of the configs are set
1 parent 393926d commit 8d5b605

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

helm/robusta/templates/runner.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ spec:
4343
{{- toYaml . | nindent 8 }}
4444
{{- end }}
4545
{{- if .Values.runner.dnsConfig.enabled }}
46-
dnsPolicy: {{ .Values.runner.dnsConfig.policy | quote }}
46+
{{- $policy := .Values.runner.dnsConfig.policy }}
47+
{{- $hasConfig := or .Values.runner.dnsConfig.nameservers .Values.runner.dnsConfig.searches .Values.runner.dnsConfig.options }}
48+
49+
{{- if and (eq $policy "None") (not $hasConfig) }}
50+
{{- fail "dnsConfig: when dnsPolicy is 'None', you must set at least one of nameservers, searches, or options" }}
51+
{{- end }}
52+
dnsPolicy: {{ $policy | quote }}
53+
{{- if $hasConfig }}
4754
dnsConfig:
4855
{{- with .Values.runner.dnsConfig.nameservers }}
4956
nameservers:
@@ -57,6 +64,7 @@ spec:
5764
options:
5865
{{- toYaml . | nindent 10 }}
5966
{{- end }}
67+
{{- end }}
6068
{{ else }}
6169
dnsPolicy: ClusterFirst
6270
{{- end }}

helm/robusta/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ runner:
759759
#Enabled custom DNS configuration for runner
760760
dnsConfig:
761761
enabled: false
762-
policy: None
762+
policy: ClusterFirst
763763
nameservers: []
764764
searches: []
765765
options: []

0 commit comments

Comments
 (0)