Skip to content

Commit ec4d94c

Browse files
chore(): dynamicvally patched all available virtual hosts
1 parent 233fb2e commit ec4d94c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

charts/ai-gateway-core/templates/envoypatchpolicy-308.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ spec:
1111
name: {{ .Values.gateway.name }}
1212
type: JSONPatch
1313
jsonPatches:
14+
{{- range $index, $domain := .Values.tls.domains }}
1415
- type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
15-
name: "{{ .Values.namespace | default .Release.Namespace }}/{{ .Values.gateway.name }}/http"
16+
name: "{{ $.Values.namespace | default $.Release.Namespace }}/{{ $.Values.gateway.name }}/http"
1617
operation:
17-
# Patching indices 1 and 2 which correspond to our actual domains
18+
# Patching all virtual hosts defined in tls.domains
1819
# Index 0 is a wildcard host that doesn't have a redirect
1920
op: add
20-
path: /virtual_hosts/1/routes/0/redirect/response_code
21-
value: "PERMANENT_REDIRECT"
22-
- type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
23-
name: "{{ .Values.namespace | default .Release.Namespace }}/{{ .Values.gateway.name }}/http"
24-
operation:
25-
op: add
26-
path: /virtual_hosts/2/routes/0/redirect/response_code
21+
path: /virtual_hosts/{{ add $index 1 }}/routes/0/redirect/response_code
2722
value: "PERMANENT_REDIRECT"
23+
{{- end }}
2824
{{- end }}

0 commit comments

Comments
 (0)