From 533f78729befa986ff2846290367401a4d2d5a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Sch=C3=B6rgers?= Date: Sat, 14 Nov 2020 14:41:05 +0100 Subject: [PATCH] [common] Resolve indenting issues, fixes #155 (#156) --- charts/common/Chart.yaml | 2 +- charts/common/templates/_deployment.tpl | 6 +++--- charts/common/templates/_ingress.tpl | 2 -- charts/common/templates/_statefulset.tpl | 6 +++--- charts/common/templates/classes/_ingress.tpl | 5 +++-- charts/common/templates/lib/chart/_values.tpl | 2 +- charts/common/values.yaml | 10 ++++++++-- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 221612be..95866652 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.4.0 +version: 1.5.0 keywords: - k8s-at-home - common diff --git a/charts/common/templates/_deployment.tpl b/charts/common/templates/_deployment.tpl index f973cac7..f76e7a87 100644 --- a/charts/common/templates/_deployment.tpl +++ b/charts/common/templates/_deployment.tpl @@ -53,14 +53,14 @@ spec: {{- with .Values.nodeSelector }} nodeSelector: - {{- toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: - {{- toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: - {{- toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/common/templates/_ingress.tpl b/charts/common/templates/_ingress.tpl index 0a4e3902..700d3735 100644 --- a/charts/common/templates/_ingress.tpl +++ b/charts/common/templates/_ingress.tpl @@ -4,7 +4,6 @@ {{- /* Generate primary ingress */ -}} {{- $ingressValues := .Values.ingress -}} - {{- $_ := set $ingressValues "svcPort" $svcPort -}} {{- $_ := set . "ObjectValues" (dict "ingress" $ingressValues) -}} {{- include "common.classes.ingress" . }} @@ -13,7 +12,6 @@ {{- if $extraIngress.enabled -}} {{- print ("---") | nindent 0 -}} {{- $ingressValues := $extraIngress -}} - {{- $_ := set $ingressValues "svcPort" $svcPort -}} {{- if not $ingressValues.nameSuffix -}} {{- $_ := set $ingressValues "nameSuffix" $index -}} {{ end -}} diff --git a/charts/common/templates/_statefulset.tpl b/charts/common/templates/_statefulset.tpl index e4348bc2..d916b529 100644 --- a/charts/common/templates/_statefulset.tpl +++ b/charts/common/templates/_statefulset.tpl @@ -54,14 +54,14 @@ spec: {{- with .Values.nodeSelector }} nodeSelector: - {{- toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: - {{- toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: - {{- toYaml . | indent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/common/templates/classes/_ingress.tpl b/charts/common/templates/classes/_ingress.tpl index abce11ac..293f30b0 100644 --- a/charts/common/templates/classes/_ingress.tpl +++ b/charts/common/templates/classes/_ingress.tpl @@ -9,7 +9,8 @@ {{- if hasKey $values "nameSuffix" -}} {{- $ingressName = printf "%v-%v" $ingressName $values.nameSuffix -}} {{ end -}} -{{- $svcPort := $values.svcPort -}} +{{- $svcName := $values.serviceName | default (include "common.names.fullname" .) -}} +{{- $svcPort := $values.servicePort | default $.Values.service.port.port -}} apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} kind: Ingress metadata: @@ -39,7 +40,7 @@ spec: {{- range .paths }} - path: {{ .path }} backend: - serviceName: {{ $ingressName }} + serviceName: {{ $svcName }} servicePort: {{ $svcPort }} {{- end }} {{- end }} diff --git a/charts/common/templates/lib/chart/_values.tpl b/charts/common/templates/lib/chart/_values.tpl index 33bf9d5c..e89eda1a 100644 --- a/charts/common/templates/lib/chart/_values.tpl +++ b/charts/common/templates/lib/chart/_values.tpl @@ -3,7 +3,7 @@ {{- if .Values.common -}} {{- $defaultValues := deepCopy .Values.common -}} {{- $userValues := deepCopy (omit .Values "common") -}} - {{- $mergedValues := mustMerge $userValues $defaultValues -}} + {{- $mergedValues := mustMergeOverwrite $defaultValues $userValues -}} {{- $_ := set . "Values" (deepCopy $mergedValues) -}} {{- end }} {{- end }} diff --git a/charts/common/values.yaml b/charts/common/values.yaml index 344523e8..1dd40022 100644 --- a/charts/common/values.yaml +++ b/charts/common/values.yaml @@ -102,8 +102,8 @@ ingress: # - host: chart-example.local # paths: # - path: /api - # # Ignored if not kubeVersion >= 1.14-0 - # pathType: Prefix + # # Ignored if not kubeVersion >= 1.14-0 + # pathType: Prefix # tls: [] # # - secretName: chart-example-tls # # hosts: @@ -141,6 +141,12 @@ additionalVolumes: [] additionalVolumeMounts: [] +nodeSelector: {} + +affinity: {} + +tolerations: [] + addons: vpn: enabled: false