Skip to content

Commit

Permalink
Merge pull request #2105 from chris8205/fix/trailing_ingress_slashes
Browse files Browse the repository at this point in the history
Fix/trailing ingress slashes
  • Loading branch information
hylkevds authored Jan 30, 2025
2 parents 1ef26a3 + 64822b9 commit 52b3a0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion helm/frost-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 "/<urlSubpath>"
!! 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 -}}

Expand All @@ -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 "/<urlSubpath>"
!! 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 -}}
Expand Down
4 changes: 2 additions & 2 deletions helm/frost-server/templates/http-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
{{- end -}}

0 comments on commit 52b3a0f

Please sign in to comment.