Skip to content

Commit 555cb54

Browse files
authored
fix: Fix the malfunction of AI route fallback (#134)
1 parent 25f3548 commit 555cb54

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: networking.istio.io/v1alpha3
2+
kind: EnvoyFilter
3+
metadata:
4+
name: higress-gateway-global-custom-response
5+
namespace: higress-system
6+
creationTimestamp: "2000-01-01T00:00:00Z"
7+
resourceVersion: "1"
8+
labels:
9+
app: higress-gateway
10+
higress: higress-system-higress-gateway
11+
spec:
12+
configPatches:
13+
- applyTo: HTTP_FILTER
14+
match:
15+
context: GATEWAY
16+
listener:
17+
filterChain:
18+
filter:
19+
name: envoy.filters.network.http_connection_manager
20+
patch:
21+
operation: INSERT_FIRST
22+
value:
23+
name: envoy.filters.http.custom_response
24+
typed_config:
25+
'@type': type.googleapis.com/envoy.extensions.filters.http.custom_response.v3.CustomResponse

compose/scripts/prepare.sh

+31
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,37 @@ EOF
352352

353353
mkdir -p $VOLUMES_ROOT/gateway/log
354354
touch $VOLUMES_ROOT/gateway/log/access.log
355+
356+
checkConfigExists "higress-system" "networking.istio.io/v1alpha3" "envoyfilters" "higress-gateway-global-custom-response"
357+
if [ $? -ne 0 ]; then
358+
echo " The EnvoyFilter resource \"higress-gateway-global-custom-response\" doesn't exist. Create it now..."
359+
read -r -d '' content <<EOF
360+
apiVersion: networking.istio.io/v1alpha3
361+
kind: EnvoyFilter
362+
metadata:
363+
name: higress-gateway-global-custom-response
364+
namespace: higress-system
365+
labels:
366+
app: higress-gateway
367+
higress: higress-system-higress-gateway
368+
spec:
369+
configPatches:
370+
- applyTo: HTTP_FILTER
371+
match:
372+
context: GATEWAY
373+
listener:
374+
filterChain:
375+
filter:
376+
name: envoy.filters.network.http_connection_manager
377+
patch:
378+
operation: INSERT_FIRST
379+
value:
380+
name: envoy.filters.http.custom_response
381+
typed_config:
382+
'@type': type.googleapis.com/envoy.extensions.filters.http.custom_response.v3.CustomResponse
383+
EOF
384+
publishConfig "higress-system" "networking.istio.io/v1alpha3" "envoyfilters" "higress-gateway-global-custom-response" "$content"
385+
fi
355386
}
356387

357388
checkConsole() {

0 commit comments

Comments
 (0)