diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 765fca4b..233134d5 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: Function library for k8s-at-home charts type: library -version: 1.6.0 +version: 1.6.1 keywords: - k8s-at-home - common diff --git a/charts/common/templates/_daemonset.tpl b/charts/common/templates/_daemonset.tpl index 6dbcd65e..035f1b66 100644 --- a/charts/common/templates/_daemonset.tpl +++ b/charts/common/templates/_daemonset.tpl @@ -53,8 +53,10 @@ spec: {{- with .Values.additionalContainers }} {{- toYaml . | nindent 6 }} {{- end }} + {{- with (include "common.controller.volumes" . | trim) }} volumes: - {{- include "common.controller.volumes" . | trim | nindent 6 }} + {{- . | nindent 6 }} + {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 8 }} diff --git a/charts/common/templates/_deployment.tpl b/charts/common/templates/_deployment.tpl index eb4faf44..0a695e0a 100644 --- a/charts/common/templates/_deployment.tpl +++ b/charts/common/templates/_deployment.tpl @@ -58,10 +58,10 @@ spec: {{- with .Values.additionalContainers }} {{- toYaml . | nindent 6 }} {{- end }} - + {{- with (include "common.controller.volumes" . | trim) }} volumes: - {{- include "common.controller.volumes" . | trim | nindent 6 }} - + {{- . | nindent 6 }} + {{- end }} {{- with .Values.hostAliases }} hostAliases: {{- toYaml . | nindent 8 }} diff --git a/charts/common/templates/_statefulset.tpl b/charts/common/templates/_statefulset.tpl index 73d6a123..a692d408 100644 --- a/charts/common/templates/_statefulset.tpl +++ b/charts/common/templates/_statefulset.tpl @@ -53,10 +53,10 @@ spec: {{- with .Values.additionalContainers }} {{- toYaml . | nindent 6 }} {{- end }} - + {{- with (include "common.controller.volumes" . | trim) }} volumes: - {{- include "common.controller.volumes" . | trim | nindent 6 }} - + {{- . | nindent 6 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/common/templates/lib/controller/_ports.tpl b/charts/common/templates/lib/controller/_ports.tpl index e80e7fd8..020a85cf 100644 --- a/charts/common/templates/lib/controller/_ports.tpl +++ b/charts/common/templates/lib/controller/_ports.tpl @@ -7,6 +7,7 @@ Ports included by the controller. {{- $serviceValues := deepCopy . -}} {{/* append the ports for the main service */}} {{- if .enabled -}} + {{- $_ := set .port "name" (default "http" .port.name) -}} {{- $ports = mustAppend $ports .port -}} {{- range $_ := .additionalPorts -}} {{/* append the additonalPorts for the main service */}} @@ -16,6 +17,7 @@ Ports included by the controller. {{/* append the ports for each additional service */}} {{- range $_ := .additionalServices }} {{- if .enabled -}} + {{- $_ := set .port "name" (required "Missing port.name" .port.name) -}} {{- $ports = mustAppend $ports .port -}} {{- range $_ := .additionalPorts -}} {{/* append the additonalPorts for each additional service */}} @@ -24,13 +26,14 @@ Ports included by the controller. {{- end }} {{- end }} {{- end }} - {{/* export/render the list of ports */}} - {{- if $ports -}} - ports: - {{- range $_ := $ports }} - - name: {{ required "Missing port.name" .name }} - containerPort: {{ required "Missing port.port" .port }} - protocol: {{ .protocol | default "TCP" }} - {{- end -}} - {{- end -}} + +{{/* export/render the list of ports */}} +{{- if $ports -}} +ports: +{{- range $_ := $ports }} +- name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} +{{- end -}} +{{- end -}} {{- end -}}