From aafd64e600117f5066141a9d127d89195e03cf28 Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Tue, 5 Mar 2024 15:48:56 -0500 Subject: [PATCH] add ingress hostname definition without protocol for ingress spec Signed-off-by: Michael Valdron --- deploy/chart/devfile-registry/templates/_template.tpl | 5 +++++ deploy/chart/devfile-registry/templates/ingress.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy/chart/devfile-registry/templates/_template.tpl b/deploy/chart/devfile-registry/templates/_template.tpl index 4eba850a1..17f79d955 100644 --- a/deploy/chart/devfile-registry/templates/_template.tpl +++ b/deploy/chart/devfile-registry/templates/_template.tpl @@ -17,6 +17,11 @@ {{- .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}} {{- end -}} +{{- define "devfileregistry.ingressHostname" -}} +{{- $hostname := .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}} +{{- .Values.global.ingress.domain | printf "%s.%s" $hostname -}} +{{- end -}} + {{- define "devfileregistry.ingressUrl" -}} {{- $hostname := .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}} {{- if .Values.global.tlsEnabled -}} diff --git a/deploy/chart/devfile-registry/templates/ingress.yaml b/deploy/chart/devfile-registry/templates/ingress.yaml index 7c54900f2..a42df4475 100644 --- a/deploy/chart/devfile-registry/templates/ingress.yaml +++ b/deploy/chart/devfile-registry/templates/ingress.yaml @@ -26,7 +26,7 @@ metadata: kubernetes.io/ingress.class: {{ .Values.global.ingress.class }} spec: rules: - - host: {{ template "devfileregistry.ingressUrl" . }} + - host: {{ template "devfileregistry.ingressHostname" . }} http: paths: - path: /