Skip to content

Commit

Permalink
add support for exact url matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Peder Amlie committed Apr 19, 2021
1 parent c733d18 commit 7123279
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/platform-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: Platform service chart
name: platform-service
version: 1.0.23
version: 1.0.24
19 changes: 19 additions & 0 deletions charts/platform-service/templates/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ spec:
- {{ required "A valid .Values.gateway.name entry required!" .Values.gateway.name }}
{{- $prefixes := default (list .Values.app) .Values.defaultRouting.urlPrefixes }}
http:
{{- if .Values.defaultRouting.urlExactMatches }}
match:
{{- range .Values.defaultRouting.urlExactMatches }}
{{- if hasPrefix "/" . }}
{{ fail "url matches must not include leading slash"}}
{{- end}}
{{- $slashMatch := printf "/%s" . }}
- uri:
exact: {{ $slashMatch }}
{{- end }}
# routes to service
- route:
- destination:
host: {{ include "platform-service.serviceName" . | quote }}
{{- if .Values.defaultRouting.corsPolicy }}
corsPolicy:
{{ .Values.defaultRouting.corsPolicy | toYaml | trim | indent 6 }}
{{- end -}}

{{- if .Values.defaultRouting.redirectOnNoTrailingSlash }}
# redirect on prefixes without trailing slashes
{{- range $prefixes }}
Expand Down

0 comments on commit 7123279

Please sign in to comment.