Quellcode durchsuchen

Generate host networking configuration separately

sonicaj vor 4 Jahren
Ursprung
Commit
6776dadd67

+ 13 - 0
test/ix-chart/2108.0.0/templates/_networking.tpl

@@ -8,3 +8,16 @@ dnsConfig:
   {{- toYaml .Values.dnsConfig | nindent 2 }}
 {{- end }}
 {{- end }}
+
+
+{{/*
+Get configuration for host network
+*/}}
+{{- define "hostNetworkingConfiguration" -}}
+{{- $host := default false .Values.hostNetwork -}}
+{{- if or .Values.externalInterfaces (eq $host false) -}}
+{{- print "false" -}}
+{{- else -}}
+{{- print "true" -}}
+{{- end -}}
+{{- end -}}

+ 1 - 1
test/ix-chart/2108.0.0/templates/_workload.tpl

@@ -51,7 +51,7 @@ Pod specification
 */}}
 {{- define "podSepc" }}
 restartPolicy: {{ template "restartPolicy" . }}
-hostNetwork: {{ .Values.hostNetwork }}
+hostNetwork: {{ template "hostNetworkingConfiguration" . }}
 containers:
 - name: {{ .Chart.Name }}
   {{- include "volumeMountsConfiguration" . | indent 2}}