From: demskeq8 Date: Tue, 22 Aug 2023 09:06:10 +0000 (+0000) Subject: [COMMON] Rendering issue of templ common.nginxIngress for sub-components X-Git-Tag: 13.0.0-DOC~17 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=oom.git;a=commitdiff_plain;h=7284be8ba0d7a77261542cd111d79e4e4ab1c4db [COMMON] Rendering issue of templ common.nginxIngress for sub-components Fix context handling for templates common.nginxIngress and ingress.config.port Issue-ID: OOM-3237 Change-Id: Idabcdf8ca564d60e2d2471c7fde38412dc478b50 Signed-off-by: demskeq8 --- diff --git a/kubernetes/common/common/templates/_ingress.tpl b/kubernetes/common/common/templates/_ingress.tpl index 968cb65a78..c469bc7c7e 100644 --- a/kubernetes/common/common/templates/_ingress.tpl +++ b/kubernetes/common/common/templates/_ingress.tpl @@ -305,7 +305,7 @@ true */}} {{- define "ingress.config.port" -}} {{- $dot := default . .dot -}} -{{ range .Values.ingress.service }} +{{ range $dot.Values.ingress.service }} {{- $baseaddr := (required "'baseaddr' param, set to the specific part of the fqdn, is required." .baseaddr) }} - host: {{ include "ingress.config.host" (dict "dot" $dot "baseaddr" $baseaddr) }} http: @@ -719,7 +719,7 @@ spec: {{- define "common.nginxIngress" -}} {{- $dot := default . .dot -}} {{ range $dot.Values.ingress.service }} -{{ if eq (include "common.ingress._protocol" (dict "dot" .)) "http" }} +{{ if eq (include "common.ingress._protocol" (dict "dot" $dot)) "http" }} {{ $baseaddr := required "baseaddr" .baseaddr }} apiVersion: networking.k8s.io/v1 kind: Ingress @@ -734,7 +734,7 @@ metadata: heritage: {{ $dot.Release.Service }} spec: rules: - {{ include "ingress.config.port" . | trim }} + {{ include "ingress.config.port" $dot | trim }} {{- if $dot.Values.ingress.tls }} tls: {{ toYaml $dot.Values.ingress.tls | indent 4 }} @@ -743,7 +743,7 @@ spec: {{- if $dot.Values.ingress.config.tls }} tls: - hosts: - - {{ include "ingress.config.host" (dict "dot" . "baseaddr" $baseaddr) }} + - {{ include "ingress.config.host" (dict "dot" $dot "baseaddr" $baseaddr) }} secretName: {{ required "secret" (tpl (default "" $dot.Values.ingress.config.tls.secret) $dot) }} {{- end }} {{- end }}