From 422e8c7323de70b0224193c24d7ac7011c9eb8f8 Mon Sep 17 00:00:00 2001 From: Lucjan Bryndza Date: Tue, 12 May 2020 09:26:32 +0000 Subject: Fix missing template arguments Fix missing template arguments for robot template ingress script Issue-ID: OOM-2341 Change-Id: I93386cc010830cad3e9a05875f18d01c0a01b0e5 Signed-off-by: Lucjan Bryndza (cherry picked from commit 84767148fb032832adfe4b85f2b6bcf311525bdb) --- templates/_ingress_svc_hostname.tpl | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/templates/_ingress_svc_hostname.tpl b/templates/_ingress_svc_hostname.tpl index 472c121..160bfbf 100644 --- a/templates/_ingress_svc_hostname.tpl +++ b/templates/_ingress_svc_hostname.tpl @@ -28,16 +28,24 @@ {{- define "robot.ingress.svchost._isen" -}} {{- $key := .key -}} {{- $master := .parent.Values.config.useIngressHost -}} - {{- if hasKey $master $key -}} - {{- $en_parent := (index $master $key) -}} - {{- if hasKey $en_parent "enabled" -}} - {{- default "" (index $en_parent "enabled") -}} - {{- else -}} - {{- "" -}} - {{- end -}} + {{- if hasKey $master "enabled" -}} + {{- if (index $master "enabled") -}} + {{- if hasKey $master $key -}} + {{- $en_parent := (index $master $key) -}} + {{- if hasKey $en_parent "enabled" -}} + {{- default "" (index $en_parent "enabled") -}} + {{- else -}} + {{- "" -}} + {{- end -}} + {{- else -}} + {{- "" -}} + {{- end -}} {{- else -}} {{- "" -}} {{- end -}} + {{- else -}} + {{- "" -}} + {{- end -}} {{- end -}} {{/* @@ -111,7 +119,7 @@ {{- if .root.Values.global.ingress -}} {{- if .root.Values.global.ingress.virtualhost -}} {{- $domain := .root.Values.global.ingress.virtualhost.baseurl -}} - {{- $ihostname := default $hostname (include "robot.ingress.svchost._inghost") -}} + {{- $ihostname := default $hostname (include "robot.ingress.svchost._inghost" (dict "parent" .root "key" $tplhname)) -}} {{- printf "%s.%s" $ihostname $domain -}} {{- end -}} {{- end -}} -- cgit 1.2.3-korg