Skip to content

Commit

Permalink
Merge pull request #120 from MediaMarktSaturn/application-configurabl…
Browse files Browse the repository at this point in the history
…e-httproute-rewrite

[Application] Make url rewrite with gateway api configurable
  • Loading branch information
heubeck committed Jun 12, 2024
2 parents 04b263a + 7e746e2 commit 12da20b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion chart-tests/application/ci/test-gateway-api-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ resources:
gatewayApi:
enabled: true
pathPrefix: /examine
stripPathPrefix: true
gatewayRef:
name: http-gateway
namespace: default
2 changes: 1 addition & 1 deletion charts/application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ maintainers:
- name: MediaMarktSaturn
url: https://github.com/MediaMarktSaturn
appVersion: 1.0.0
version: 1.14.2
version: 1.15.0
5 changes: 3 additions & 2 deletions charts/application/templates/flagger-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ spec:
match:
- uri:
prefix: {{ .Values.gatewayApi.pathPrefix | quote }}
{{- if .Values.gatewayApi.stripPathPrefix }}
{{- if .Values.gatewayApi.pathPrefixRewrite }}
rewrite:
uri: /
uri: {{ .Values.gatewayApi.pathPrefixRewrite | quote }}
type: ReplacePrefixMatch
{{- end }}
{{- end }}
gatewayRefs:
Expand Down
6 changes: 3 additions & 3 deletions charts/application/templates/k8s-http-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ spec:
- path:
type: PathPrefix
value: {{ .Values.gatewayApi.pathPrefix | quote }}
{{- if .Values.gatewayApi.stripPathPrefix }}
{{- if .Values.gatewayApi.pathPrefixRewrite }}
filters:
- type: URLRewrite
urlRewrite:
path:
replaceFullPath: /
type: ReplaceFullPath
replacePrefixMatch: {{ .Values.gatewayApi.pathPrefixRewrite | quote }}
type: ReplacePrefixMatch
{{- end }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ linkerd:
gatewayApi:
enabled: false
host:
# optional first url part to match this services http route
pathPrefix:
stripPathPrefix: false
# optionally rewrite (or remove) the matched url prefix
pathPrefixRewrite: /
gatewayRef:
name:
namespace:
Expand Down

0 comments on commit 12da20b

Please sign in to comment.