From 9ecc36345eb1c8446be74bd1cbfbc1ba40805a17 Mon Sep 17 00:00:00 2001 From: Javion Cai Date: Wed, 28 Jun 2023 07:02:33 +0000 Subject: [PATCH 1/2] SecretName will only be set if tlsSecret exists. --- charts/gitlab/charts/webservice/templates/ingress.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/gitlab/charts/webservice/templates/ingress.yaml b/charts/gitlab/charts/webservice/templates/ingress.yaml index f07d45a34a..f46e9e34fa 100644 --- a/charts/gitlab/charts/webservice/templates/ingress.yaml +++ b/charts/gitlab/charts/webservice/templates/ingress.yaml @@ -66,11 +66,13 @@ spec: serviceName: {{ template "webservice.fullname.withSuffix" . }} servicePort: {{ $.Values.service.workhorseExternalPort }} {{- end -}} - {{- if (and $tlsSecret (eq (include "gitlab.ingress.tls.enabled" $) "true" )) }} + {{- if (eq (include "gitlab.ingress.tls.enabled" $) "true") }} tls: - hosts: - {{ $gitlabHostname }} + {{- if $tlsSecret }} secretName: {{ $tlsSecret }} + {{- end -}} {{- else }} tls: [] {{- end }} -- GitLab From 09fa63c3c4b4e678f5d2c9ca7e6437a7dbd714eb Mon Sep 17 00:00:00 2001 From: Javion Cai Date: Wed, 28 Jun 2023 07:05:06 +0000 Subject: [PATCH 2/2] Update file ingress.yaml --- charts/gitlab/charts/kas/templates/ingress.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/gitlab/charts/kas/templates/ingress.yaml b/charts/gitlab/charts/kas/templates/ingress.yaml index ee5fc6edee..c7e07266e8 100644 --- a/charts/gitlab/charts/kas/templates/ingress.yaml +++ b/charts/gitlab/charts/kas/templates/ingress.yaml @@ -64,11 +64,13 @@ spec: serviceName: {{ template "gitlab.kas.serviceName" . }} servicePort: {{ .Values.service.externalPort }} {{- end }} - {{- if (and $tlsSecret (eq (include "gitlab.ingress.tls.enabled" $) "true" )) }} + {{- if (eq (include "gitlab.ingress.tls.enabled" $) "true") }} tls: - hosts: - {{ $hostname }} + {{- if $tlsSecret }} secretName: {{ $tlsSecret }} + {{- end -}} {{- else }} tls: [] {{- end }} -- GitLab