Skip to content

Commit 69823cd

Browse files
zhaohuabingzirain
authored andcommitted
add test
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
1 parent 777a634 commit 69823cd

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,32 @@ http:
101101
- host: "1.2.3.4"
102102
port: 50002
103103
name: "seventh-route-dest/backend/0"
104+
- name: "second-listener"
105+
address: "::"
106+
port: 10081
107+
hostnames:
108+
- "*"
109+
path:
110+
mergeSlashes: true
111+
escapedSlashesAction: UnescapeAndRedirect
112+
timeout:
113+
http:
114+
streamIdleTimeout: 10s
115+
routes:
116+
- name: "first-route"
117+
hostname: "*"
118+
traffic:
119+
timeout:
120+
http:
121+
requestTimeout: 5s # should not set route-level idle timeout because listener has it
122+
headerMatches:
123+
- name: user
124+
stringMatch:
125+
exact: "jason"
126+
destination:
127+
name: "first-route-dest"
128+
settings:
129+
- endpoints:
130+
- host: "1.2.3.4"
131+
port: 50000
132+
name: "first-route-dest/backend/0"

internal/xds/translator/testdata/out/xds-ir/http-route-timeout.listeners.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,39 @@
3333
maxConnectionsToAcceptPerSocketEvent: 1
3434
name: first-listener
3535
perConnectionBufferLimitBytes: 32768
36+
- address:
37+
socketAddress:
38+
address: '::'
39+
portValue: 10081
40+
defaultFilterChain:
41+
filters:
42+
- name: envoy.filters.network.http_connection_manager
43+
typedConfig:
44+
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
45+
commonHttpProtocolOptions:
46+
headersWithUnderscoresAction: REJECT_REQUEST
47+
http2ProtocolOptions:
48+
initialConnectionWindowSize: 1048576
49+
initialStreamWindowSize: 65536
50+
maxConcurrentStreams: 100
51+
httpFilters:
52+
- name: envoy.filters.http.router
53+
typedConfig:
54+
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
55+
suppressEnvoyHeaders: true
56+
mergeSlashes: true
57+
normalizePath: true
58+
pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT
59+
rds:
60+
configSource:
61+
ads: {}
62+
resourceApiVersion: V3
63+
routeConfigName: second-listener
64+
serverHeaderTransformation: PASS_THROUGH
65+
statPrefix: http-10081
66+
streamIdleTimeout: 10s
67+
useRemoteAddress: true
68+
name: second-listener
69+
maxConnectionsToAcceptPerSocketEvent: 1
70+
name: second-listener
71+
perConnectionBufferLimitBytes: 32768

internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,22 @@
7676
timeout: 0s
7777
upgradeConfigs:
7878
- upgradeType: websocket
79+
- ignorePortInHostMatching: true
80+
name: second-listener
81+
virtualHosts:
82+
- domains:
83+
- '*'
84+
name: second-listener/*
85+
routes:
86+
- match:
87+
headers:
88+
- name: user
89+
stringMatch:
90+
exact: jason
91+
prefix: /
92+
name: first-route
93+
route:
94+
cluster: first-route-dest
95+
timeout: 5s
96+
upgradeConfigs:
97+
- upgradeType: websocket

0 commit comments

Comments
 (0)