mirror of
https://github.com/truenas/charts.git
synced 2026-11-30 07:46:52 +08:00
Generate host networking configuration separately
This commit is contained in:
@@ -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 -}}
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user