summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-10-30 17:57:16 +0100
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-01-26 08:55:07 +0000
commit7787e489fe02bb7ca0fb7f79a0d68c869f8f5217 (patch)
treeb207fc0b9f1486194add44e90bb5c241735556e3
parent8ab4fba7165b3b9418730cb1cdd424346925a93f (diff)
[COMMON] Fix Ingress templating
New TLS part of Ingress templating was broken. This commit fixes it. Issue-ID: OOM-2609 Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com> Change-Id: I0b9b41e052911ef0064696ac7cf6ca8a274ae1dd
-rw-r--r--kubernetes/common/common/templates/_ingress.tpl20
1 files changed, 13 insertions, 7 deletions
diff --git a/kubernetes/common/common/templates/_ingress.tpl b/kubernetes/common/common/templates/_ingress.tpl
index 18f9bb1ba5..7fee67a7a4 100644
--- a/kubernetes/common/common/templates/_ingress.tpl
+++ b/kubernetes/common/common/templates/_ingress.tpl
@@ -1,9 +1,15 @@
-{{- define "ingress.config.port" -}}
+{{- define "ingress.config.host" -}}
{{- $dot := default . .dot -}}
+{{- $baseaddr := (required "'baseaddr' param, set to the specific part of the fqdn, is required." .baseaddr) -}}
{{- $burl := (required "'baseurl' param, set to the generic part of the fqdn, is required." $dot.Values.global.ingress.virtualhost.baseurl) -}}
+{{ printf "%s.%s" $baseaddr $burl }}
+{{- end -}}
+
+{{- define "ingress.config.port" -}}
+{{- $dot := default . .dot -}}
{{ range .Values.ingress.service }}
{{- $baseaddr := (required "'baseaddr' param, set to the specific part of the fqdn, is required." .baseaddr) }}
- - host: {{ printf "%s.%s" $baseaddr $burl }}
+ - host: {{ include "ingress.config.host" (dict "dot" $dot "baseaddr" $baseaddr) }}
http:
paths:
- backend:
@@ -83,12 +89,12 @@ spec:
{{- end -}}
{{- if .Values.ingress.config -}}
{{- if .Values.ingress.config.tls -}}
-{{- $dot := default . .dot -}}
+{{- $dot := default . .dot }}
tls:
- - hosts:
- {{- range .Values.ingress.service }}{{ $baseaddr := required "baseaddr" .baseaddr }}
- - {{ include "ingress.config.host" (dict "dot" $dot "baseaddr" $baseaddr) }}
- {{- end }}
+ - hosts:
+ {{- range .Values.ingress.service }}{{ $baseaddr := required "baseaddr" .baseaddr }}
+ - {{ include "ingress.config.host" (dict "dot" $dot "baseaddr" $baseaddr) }}
+ {{- end }}
secretName: {{ required "secret" (tpl (default "" .Values.ingress.config.tls.secret) $dot) }}
{{- end -}}
{{- end -}}