diff --git a/library/common/templates/class/_ingress.tpl b/library/common/templates/class/_ingress.tpl index 5082c59d..9e84b064 100644 --- a/library/common/templates/class/_ingress.tpl +++ b/library/common/templates/class/_ingress.tpl @@ -17,7 +17,6 @@ within the common library. {{- $ingressName = $values.name -}} - {{/* Get the name of the primary service, if any */}} {{- $primaryServiceName := (include "tc.v1.common.lib.util.service.primary" (dict "services" .Values.service "root" .)) -}} {{/* Get service values of the primary service, if any */}} @@ -32,12 +31,17 @@ within the common library. {{- $mddwrNamespace := "tc-system" -}} {{- if $.Values.operator.traefik -}} {{- if $.Values.operator.traefik.namespace -}} - {{- $mddwrNamespace := (printf "ix-%s" $values.ingressClassName) -}} + {{- $mddwrNamespace = $.Values.operator.traefik.namespace -}} {{- end -}} {{- end -}} {{- if $values.ingressClassName -}} - {{- $mddwrNamespace = $values.ingressClassName -}} + + {{- if $.Values.global.ixChartContext -}} + {{- $mddwrNamespace = (printf "ix-%s" $values.ingressClassName) -}} + {{- else -}} + {{- $mddwrNamespace = $values.ingressClassName -}} + {{- end -}} {{- end -}} {{- $fixedMiddlewares := "" -}} diff --git a/library/common/templates/lib/util/_chartcontext.tpl b/library/common/templates/lib/util/_chartcontext.tpl index dd05c328..214d7309 100644 --- a/library/common/templates/lib/util/_chartcontext.tpl +++ b/library/common/templates/lib/util/_chartcontext.tpl @@ -43,20 +43,22 @@ {{- end -}} {{/* Get the port for the ingress entrypoint */}} - {{- $namespace := "tc-system" -}} {{- if $.Values.operator.traefik -}} {{- if $.Values.operator.traefik.namespace -}} - {{- $namespace := $.Values.operator.traefik.namespace -}} + {{- $namespace = $.Values.operator.traefik.namespace -}} {{- end -}} {{- end -}} - {{- if $selectedIngress.ingressClassName }} - {{- $namespace = $selectedIngress.ingressClassName -}} - {{- end -}} {{- if $selectedIngress.ingressClassName -}} - {{- $namespace = (printf "ix-%s" $selectedIngress.ingressClassName) -}} + {{- if $.Values.global.ixChartContext -}} + {{- $namespace = (printf "ix-%s" $selectedIngress.ingressClassName) -}} + {{- else -}} + {{- $namespace = $selectedIngress.ingressClassName -}} + {{- end -}} + {{- end -}} + {{- $traefikportalhook := lookup "v1" "ConfigMap" $namespace "portalhook" -}} {{- $entrypoint := "websecure" -}} {{- if $selectedIngress.entrypoint -}}