feat: higress global configmap support config route timeout (#883)

This commit is contained in:
alexzzh
2024-04-07 10:45:25 +08:00
committed by GitHub
parent dfc9ae412e
commit 6c7b1757b6
2 changed files with 211 additions and 2 deletions

View File

@@ -50,6 +50,7 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 15,
},
Upstream: &configmap.Upstream{
IdleTimeout: 10,
@@ -121,6 +122,14 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"timeout": "15s",
},
},
{
Path: "configs.#.dynamic_active_clusters.#.cluster",
CheckType: envoy.CheckTypeMatch,
@@ -146,6 +155,7 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 15,
},
Upstream: &configmap.Upstream{
IdleTimeout: 10,
@@ -209,6 +219,14 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"timeout": "15s",
},
},
{
Path: "configs.#.dynamic_active_clusters.#.cluster",
CheckType: envoy.CheckTypeMatch,
@@ -234,6 +252,7 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 15,
},
Upstream: &configmap.Upstream{
IdleTimeout: 10,
@@ -302,6 +321,14 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"timeout": "15s",
},
},
{
Path: "configs.#.dynamic_active_clusters.#.cluster",
CheckType: envoy.CheckTypeMatch,
@@ -327,6 +354,7 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 15,
},
Upstream: &configmap.Upstream{
IdleTimeout: 10,
@@ -387,6 +415,14 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"timeout": "15s",
},
},
{
Path: "configs.#.dynamic_active_clusters.#.cluster",
CheckType: envoy.CheckTypeMatch,
@@ -468,6 +504,14 @@ 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,
@@ -492,6 +536,7 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 15,
},
DisableXEnvoyHeaders: true,
AddXRealIpHeader: true,
@@ -559,6 +604,14 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"timeout": "15s",
},
},
{
Path: "configs.#.dynamic_active_clusters.#.cluster",
CheckType: envoy.CheckTypeMatch,
@@ -584,6 +637,7 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 60,
},
DisableXEnvoyHeaders: true,
AddXRealIpHeader: true,
@@ -651,6 +705,14 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
Path: "configs.#.dynamic_route_configs.#.route_config.virtual_hosts.#.routes.#.route",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"timeout": "60s",
},
},
{
Path: "configs.#.dynamic_active_clusters.#.cluster",
CheckType: envoy.CheckTypeMatch,
@@ -716,6 +778,14 @@ 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,
@@ -819,6 +889,106 @@ var ConfigMapGlobalEnvoy = suite.ConformanceTest{
},
},
},
{
name: "close the setting of route timeout in downstream",
higressConfig: &configmap.HigressConfig{
Downstream: &configmap.Downstream{
IdleTimeout: 180,
MaxRequestHeadersKb: 60,
ConnectionBufferLimits: 32768,
Http2: &configmap.Http2{
MaxConcurrentStreams: 100,
InitialStreamWindowSize: 65535,
InitialConnectionWindowSize: 1048576,
},
RouteTimeout: 0,
},
Upstream: &configmap.Upstream{
IdleTimeout: 10,
},
DisableXEnvoyHeaders: true,
AddXRealIpHeader: true,
},
envoyAssertion: []envoy.Assertion{
{
Path: "configs.#.dynamic_route_configs.#.route_config",
CheckType: envoy.CheckTypeExist,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"request_headers_to_add": []interface{}{
map[string]interface{}{
"append": false,
"header": map[string]interface{}{
"key": "x-real-ip",
"value": "%REQ(X-ENVOY-EXTERNAL-ADDRESS)%",
},
},
},
},
},
{
Path: "configs.#.dynamic_listeners.#.active_state.listener.filter_chains.#.filters.#.typed_config",
CheckType: envoy.CheckTypeExist,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "outbound_0.0.0.0_80",
},
},
{
Path: "configs.#.dynamic_listeners.#.active_state.listener.filter_chains.#.filters.#.typed_config.http_filters",
CheckType: envoy.CheckTypeMatch,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"name": "envoy.filters.http.router",
"typed_config": map[string]interface{}{
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router",
"suppress_envoy_headers": true,
},
},
},
{
Path: "configs.#.dynamic_listeners.#.active_state.listener",
CheckType: envoy.CheckTypeExist,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"per_connection_buffer_limit_bytes": 32768,
},
},
{
Path: "configs.#.dynamic_listeners.#.active_state.listener.filter_chains.#.filters.#.typed_config",
CheckType: envoy.CheckTypeExist,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"max_concurrent_streams": 100,
"initial_stream_window_size": 65535,
"initial_connection_window_size": 1048576,
"stream_idle_timeout": "180s",
"max_request_headers_kb": 60,
"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,
TargetNamespace: "higress-system",
ExpectEnvoyConfig: map[string]interface{}{
"common_http_protocol_options": map[string]interface{}{
"idle_timeout": "10s",
},
"per_connection_buffer_limit_bytes": 10485760,
},
},
},
},
{
name: "close the setting of idle timeout in upstream",
higressConfig: &configmap.HigressConfig{