From af8eff2bd6c07cd56c1ec455a628500b071eecfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Tue, 21 May 2024 23:57:13 +0800 Subject: [PATCH] optimize default action of route envoyfilter (#985) --- pkg/ingress/kube/configmap/global.go | 3 +++ .../e2e/conformance/tests/configmap-global.go | 24 ------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/pkg/ingress/kube/configmap/global.go b/pkg/ingress/kube/configmap/global.go index 45c362445..0804062d3 100644 --- a/pkg/ingress/kube/configmap/global.go +++ b/pkg/ingress/kube/configmap/global.go @@ -636,6 +636,9 @@ func (g *GlobalOptionController) constructBufferLimit(downstream *Downstream) st // constructRouteTimeout constructs the route timeout config. func (g *GlobalOptionController) constructRouteTimeout(downstream *Downstream) string { + if downstream.RouteTimeout == 0 { + return "" + } return fmt.Sprintf(` { "route": { diff --git a/test/e2e/conformance/tests/configmap-global.go b/test/e2e/conformance/tests/configmap-global.go index a64043bbb..2d9852ae4 100644 --- a/test/e2e/conformance/tests/configmap-global.go +++ b/test/e2e/conformance/tests/configmap-global.go @@ -504,14 +504,6 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{ "idle_timeout": "180s", }, }, - { - Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route", - CheckType: envoy.CheckTypeMatch, - TargetNamespace: "higress-system", - ExpectEnvoyConfig: map[string]interface{}{ - "timeout": "0s", - }, - }, { Path: "configs.#.dynamic_active_clusters.#.cluster", CheckType: envoy.CheckTypeMatch, @@ -778,14 +770,6 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{ "idle_timeout": "180s", }, }, - { - Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route", - CheckType: envoy.CheckTypeMatch, - TargetNamespace: "higress-system", - ExpectEnvoyConfig: map[string]interface{}{ - "timeout": "0s", - }, - }, { Path: "configs.#.dynamic_active_clusters.#.cluster", CheckType: envoy.CheckTypeMatch, @@ -968,14 +952,6 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{ "idle_timeout": "180s", }, }, - { - Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route", - CheckType: envoy.CheckTypeMatch, - TargetNamespace: "higress-system", - ExpectEnvoyConfig: map[string]interface{}{ - "timeout": "0s", - }, - }, { Path: "configs.#.dynamic_active_clusters.#.cluster", CheckType: envoy.CheckTypeMatch,