Skip to content

Commit 5d1e8a8

Browse files
committed
make configuration more flexible with matches and filters blocks
replacing pathMatchType and pathValue
1 parent 288f764 commit 5d1e8a8

File tree

35 files changed

+415
-126
lines changed

35 files changed

+415
-126
lines changed

charts/o-neko-catnip/templates/httproute.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ spec:
2222
- backendRefs:
2323
- name: {{ $fullName }}
2424
port: 8080
25+
{{- with .Values.httpRoute.matches }}
2526
matches:
26-
- path:
27-
type: {{ .Values.httpRoute.pathMatchType | default "PathPrefix" }}
28-
value: {{ .Values.httpRoute.pathValue | default "/" }}
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
{{- with .Values.httpRoute.filters }}
30+
filters:
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
2933
{{- end }}

charts/o-neko-catnip/values.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,22 @@ httpRoute:
133133
# hostnames:
134134
# - "my-service.example.com"
135135
hostnames: []
136-
# httpRoute.pathMatchType Type specifies how to match against the HTTP request path. (PathPrefix, Exact or RegularExpression)
137-
pathMatchType: PathPrefix
138-
# httpRoute.pathValue Value of the HTTP request path to match against.
139-
pathValue: /
136+
# matches Optional array of HTTPRouteMatch objects for matching HTTP requests
137+
# e.g.
138+
# matches:
139+
# - path:
140+
# type: PathPrefix
141+
# value: /sophora.srpc
142+
matches: []
143+
# filters Optional array of HTTPRouteFilter objects for modifying requests/responses
144+
# e.g.
145+
# filters:
146+
# - type: RequestHeaderModifier
147+
# requestHeaderModifier:
148+
# set:
149+
# - name: X-Custom-Header
150+
# value: custom-value
151+
filters: []
140152
# httpRoute.annotations annotations for the HTTPRoute
141153
annotations: {}
142154

charts/o-neko/templates/httproute.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ spec:
2222
- backendRefs:
2323
- name: {{ $fullName }}
2424
port: 8080
25+
{{- with .Values.httpRoute.matches }}
2526
matches:
26-
- path:
27-
type: {{ .Values.httpRoute.pathMatchType | default "PathPrefix" }}
28-
value: {{ .Values.httpRoute.pathValue | default "/" }}
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
{{- with .Values.httpRoute.filters }}
30+
filters:
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
2933
{{- end }}

charts/o-neko/values.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,22 @@ httpRoute:
162162
## hostnames:
163163
## - "my-service.example.com"
164164
hostnames: []
165-
# httpRoute.pathMatchType Type specifies how to match against the HTTP request path. (PathPrefix, Exact or RegularExpression)
166-
pathMatchType: PathPrefix
167-
# httpRoute.pathValue Value of the HTTP request path to match against.
168-
pathValue: /
165+
# matches Optional array of HTTPRouteMatch objects for matching HTTP requests
166+
# e.g.
167+
# matches:
168+
# - path:
169+
# type: PathPrefix
170+
# value: /sophora.srpc
171+
matches: []
172+
# filters Optional array of HTTPRouteFilter objects for modifying requests/responses
173+
# e.g.
174+
# filters:
175+
# - type: RequestHeaderModifier
176+
# requestHeaderModifier:
177+
# set:
178+
# - name: X-Custom-Header
179+
# value: custom-value
180+
filters: []
169181
# httpRoute.annotations annotations for the HTTPRoute
170182
annotations: {}
171183

charts/sophora-admin-dashboard/templates/httproute.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ spec:
2626
- backendRefs:
2727
- name: {{ $fullName }}
2828
port: {{ $svcPort }}
29+
{{- with .Values.httpRoute.matches }}
2930
matches:
30-
- path:
31-
type: {{ .Values.httpRoute.pathMatchType | default "PathPrefix" }}
32-
value: {{ .Values.httpRoute.pathValue | default "/" }}
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
33+
{{- with .Values.httpRoute.filters }}
34+
filters:
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
3337
{{- end }}

charts/sophora-admin-dashboard/values.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,22 @@ httpRoute:
222222
# hostnames:
223223
# - "my-service.example.com"
224224
hostnames: []
225-
# httpRoute.pathMatchType Type specifies how to match against the HTTP request path. (PathPrefix, Exact or RegularExpression)
226-
pathMatchType: PathPrefix
227-
# httpRoute.pathValue Value of the HTTP request path to match against.
228-
pathValue: /
225+
# matches Optional array of HTTPRouteMatch objects for matching HTTP requests
226+
# e.g.
227+
# matches:
228+
# - path:
229+
# type: PathPrefix
230+
# value: /sophora.srpc
231+
matches: []
232+
# filters Optional array of HTTPRouteFilter objects for modifying requests/responses
233+
# e.g.
234+
# filters:
235+
# - type: RequestHeaderModifier
236+
# requestHeaderModifier:
237+
# set:
238+
# - name: X-Custom-Header
239+
# value: custom-value
240+
filters: []
229241
# httpRoute.annotations annotations for the HTTPRoute
230242
annotations: {}
231243

charts/sophora-ai/templates/httproute.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ spec:
2626
- backendRefs:
2727
- name: {{ $fullName }}
2828
port: {{ $svcPort }}
29+
{{- with .Values.httpRoute.matches }}
2930
matches:
30-
- path:
31-
type: {{ .Values.httpRoute.pathMatchType | default "PathPrefix" }}
32-
value: {{ .Values.httpRoute.pathValue | default "/" }}
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
33+
{{- with .Values.httpRoute.filters }}
34+
filters:
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
3337
{{- end }}

charts/sophora-ai/values.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,22 @@ httpRoute:
230230
# hostnames:
231231
# - "my-service.example.com"
232232
hostnames: []
233-
# httpRoute.pathMatchType Type specifies how to match against the HTTP request path. (PathPrefix, Exact or RegularExpression)
234-
pathMatchType: PathPrefix
235-
# httpRoute.pathValue Value of the HTTP request path to match against.
236-
pathValue: /
233+
# matches Optional array of HTTPRouteMatch objects for matching HTTP requests
234+
# e.g.
235+
# matches:
236+
# - path:
237+
# type: PathPrefix
238+
# value: /sophora.srpc
239+
matches: []
240+
# filters Optional array of HTTPRouteFilter objects for modifying requests/responses
241+
# e.g.
242+
# filters:
243+
# - type: RequestHeaderModifier
244+
# requestHeaderModifier:
245+
# set:
246+
# - name: X-Custom-Header
247+
# value: custom-value
248+
filters: []
237249
# httpRoute.annotations annotations for the HTTPRoute
238250
annotations: {}
239251

charts/sophora-contentapi/templates/httproute.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ spec:
2626
- backendRefs:
2727
- name: {{ $fullName }}
2828
port: {{ $svcPort }}
29+
{{- with .Values.httpRoute.matches }}
2930
matches:
30-
- path:
31-
type: {{ .Values.httpRoute.pathMatchType | default "PathPrefix" }}
32-
value: {{ .Values.httpRoute.pathValue | default "/" }}
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
33+
{{- with .Values.httpRoute.filters }}
34+
filters:
35+
{{- toYaml . | nindent 8 }}
36+
{{- end }}
3337
{{- end }}

charts/sophora-contentapi/values.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,22 @@ httpRoute:
8484
# hostnames:
8585
# - "my-service.example.com"
8686
hostnames: []
87-
# httpRoute.pathMatchType Type specifies how to match against the HTTP request path. (PathPrefix, Exact or RegularExpression)
88-
pathMatchType: PathPrefix
89-
# httpRoute.pathValue Value of the HTTP request path to match against.
90-
pathValue: /
87+
# matches Optional array of HTTPRouteMatch objects for matching HTTP requests
88+
# e.g.
89+
# matches:
90+
# - path:
91+
# type: PathPrefix
92+
# value: /sophora.srpc
93+
matches: []
94+
# filters Optional array of HTTPRouteFilter objects for modifying requests/responses
95+
# e.g.
96+
# filters:
97+
# - type: RequestHeaderModifier
98+
# requestHeaderModifier:
99+
# set:
100+
# - name: X-Custom-Header
101+
# value: custom-value
102+
filters: []
91103
# httpRoute.annotations annotations for the HTTPRoute
92104
annotations: {}
93105

0 commit comments

Comments
 (0)