Skip to content

Commit

Permalink
Fixed #2084: Helm generates trailing slash in serviceRootUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed Jan 7, 2025
1 parent f8a7124 commit 18513c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package de.fraunhofer.iosb.ilt.frostserver.query;

import org.apache.commons.lang3.StringUtils;

/**
* Class holding default values for queries.
*/
Expand Down Expand Up @@ -69,7 +71,7 @@ public QueryDefaults(boolean absNavLinks, boolean countDefault, int topDefault,
* @return this.
*/
public final QueryDefaults setServiceRootUrl(String serviceRootUrl) {
this.serviceRootUrl = serviceRootUrl;
this.serviceRootUrl = StringUtils.removeEnd(serviceRootUrl, "/");
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions helm/frost-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Get the HTTP service SubPath
*/}}
{{- define "frost-server.http.serviceSubPath" -}}
{{- if not .Values.frost.http.urlSubPath | empty -}}
{{- printf "/%s/" .Values.frost.http.urlSubPath | replace "//" "/" -}}
{{- printf "/%s" .Values.frost.http.urlSubPath | replace "//" "/" -}}
{{- else -}}
{{- printf "/" -}}
{{- printf "" -}}
{{- end -}}
{{- end -}}

Expand Down
2 changes: 1 addition & 1 deletion helm/frost-server/templates/http-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ 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:
Expand Down

0 comments on commit 18513c7

Please sign in to comment.