From e039234310b65c9bffe55bcec676b5fe47e49aaf Mon Sep 17 00:00:00 2001 From: chris8205 Date: Wed, 29 Jan 2025 16:49:18 +0100 Subject: [PATCH 1/2] Update _helpers.tpl fix trailing slashes in ingress path --- helm/frost-server/templates/_helpers.tpl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helm/frost-server/templates/_helpers.tpl b/helm/frost-server/templates/_helpers.tpl index 712a94d05..9362140d1 100644 --- a/helm/frost-server/templates/_helpers.tpl +++ b/helm/frost-server/templates/_helpers.tpl @@ -49,12 +49,15 @@ Get the HTTP service root URL. {{/* Get the HTTP service SubPath +!! this definition returns a full conform path with all necessary trailing and leading slashes !! +!! if no urlSubPath is provided returns "/" for "root" if a urlSubPath is set then it has to build "/" +!! if trailing slashes are added it results in problems with the redirect if a webrequest calls for "http://myFDQN/FROST-Server" */}} {{- define "frost-server.http.serviceSubPath" -}} {{- if not .Values.frost.http.urlSubPath | empty -}} {{- printf "/%s" .Values.frost.http.urlSubPath | replace "//" "/" -}} {{- else -}} - {{- printf "" -}} + {{- printf "/" -}} {{- end -}} {{- end -}} @@ -74,6 +77,9 @@ Get the MQTT service root URL. {{/* Get the MQTT Websock-Path. +!! this definition returns a full conform path with all necessary trailing and leading slashes !! +!! if no urlSubPath is provided returns "/" for "root" if a urlSubPath is set then it has to build "/" +!! if trailing slashes are added it results in problems with the redirect if a webrequest calls for "http://myFDQN/FROST-Server" */}} {{- define "frost-server.mqtt.websockPath" -}} {{- if not .Values.frost.mqtt.urlSubPath | empty -}} From 64822b9d7d73cec88d881a85bd54bc292e7a87ce Mon Sep 17 00:00:00 2001 From: chris8205 Date: Wed, 29 Jan 2025 16:52:35 +0100 Subject: [PATCH 2/2] Update http-ingress.yaml removing trailing slash; all trailing and leading slashes have to be calculated --- helm/frost-server/templates/http-ingress.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/frost-server/templates/http-ingress.yaml b/helm/frost-server/templates/http-ingress.yaml index fc6389265..ca4cea17e 100644 --- a/helm/frost-server/templates/http-ingress.yaml +++ b/helm/frost-server/templates/http-ingress.yaml @@ -42,11 +42,11 @@ spec: - host: {{ include "frost-server.http.serviceHost" . }} http: paths: - - path: {{ template "frost-server.http.serviceSubPath" . }}/ + - path: {{ template "frost-server.http.serviceSubPath" . }} pathType: Prefix backend: service: name: {{ $fullName }} port: number: {{ .Values.frost.http.ports.http.servicePort }} -{{- end -}} \ No newline at end of file +{{- end -}}