forked from envoyproxy/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: xds translation return early, should be done in a best-effort ma…
…nner (envoyproxy#2202) * fix: xds translation return early, should be done in a best-effort way instead Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * add test for partial invalid resources Signed-off-by: huabing zhao <zhaohuabing@gmail.com> * fix test Signed-off-by: huabing zhao <zhaohuabing@gmail.com> --------- Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
- Loading branch information
1 parent
1789d98
commit c7b1756
Showing
9 changed files
with
264 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
internal/xds/translator/testdata/in/xds-ir/http-route-partial-invalid.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
http: | ||
- name: "first-listener" | ||
address: "0.0.0.0" | ||
port: 10080 | ||
hostnames: | ||
- "*" | ||
routes: | ||
- name: "valid-route" | ||
hostname: "*" | ||
headerMatches: | ||
- name: user | ||
stringMatch: | ||
exact: "jason" | ||
- name: test | ||
stringMatch: | ||
suffix: "end" | ||
queryParamMatches: | ||
- name: "debug" | ||
exact: "yes" | ||
destination: | ||
name: "valid-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "1.2.3.4" | ||
port: 50000 | ||
- name: "invalid-route" | ||
hostname: "*" | ||
headerMatches: | ||
- name: user | ||
stringMatch: | ||
exact: "jason" | ||
- name: test | ||
stringMatch: | ||
suffix: "end" | ||
queryParamMatches: | ||
- name: "debug" | ||
exact: "yes" | ||
destination: | ||
name: "invalid-route-dest" | ||
settings: | ||
- endpoints: | ||
- host: "" | ||
port: 50000 |
14 changes: 14 additions & 0 deletions
14
internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.clusters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
- commonLbConfig: | ||
localityWeightedLbConfig: {} | ||
connectTimeout: 10s | ||
dnsLookupFamily: V4_ONLY | ||
edsClusterConfig: | ||
edsConfig: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
serviceName: valid-route-dest | ||
lbPolicy: LEAST_REQUEST | ||
name: valid-route-dest | ||
outlierDetection: {} | ||
perConnectionBufferLimitBytes: 32768 | ||
type: EDS |
12 changes: 12 additions & 0 deletions
12
internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.endpoints.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- clusterName: valid-route-dest | ||
endpoints: | ||
- lbEndpoints: | ||
- endpoint: | ||
address: | ||
socketAddress: | ||
address: 1.2.3.4 | ||
portValue: 50000 | ||
loadBalancingWeight: 1 | ||
loadBalancingWeight: 1 | ||
locality: | ||
region: valid-route-dest/backend/0 |
33 changes: 33 additions & 0 deletions
33
internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.listeners.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- address: | ||
socketAddress: | ||
address: 0.0.0.0 | ||
portValue: 10080 | ||
defaultFilterChain: | ||
filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
commonHttpProtocolOptions: | ||
headersWithUnderscoresAction: REJECT_REQUEST | ||
http2ProtocolOptions: | ||
initialConnectionWindowSize: 1048576 | ||
initialStreamWindowSize: 65536 | ||
maxConcurrentStreams: 100 | ||
httpFilters: | ||
- name: envoy.filters.http.router | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
mergeSlashes: true | ||
normalizePath: true | ||
pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT | ||
rds: | ||
configSource: | ||
ads: {} | ||
resourceApiVersion: V3 | ||
routeConfigName: first-listener | ||
statPrefix: http | ||
upgradeConfigs: | ||
- upgradeType: websocket | ||
useRemoteAddress: true | ||
name: first-listener | ||
perConnectionBufferLimitBytes: 32768 |
39 changes: 39 additions & 0 deletions
39
internal/xds/translator/testdata/out/xds-ir/http-route-partial-invalid.routes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
- ignorePortInHostMatching: true | ||
name: first-listener | ||
virtualHosts: | ||
- domains: | ||
- '*' | ||
name: first-listener/* | ||
routes: | ||
- match: | ||
headers: | ||
- name: user | ||
stringMatch: | ||
exact: jason | ||
- name: test | ||
stringMatch: | ||
suffix: end | ||
prefix: / | ||
queryParameters: | ||
- name: debug | ||
stringMatch: | ||
exact: "yes" | ||
name: valid-route | ||
route: | ||
cluster: valid-route-dest | ||
- match: | ||
headers: | ||
- name: user | ||
stringMatch: | ||
exact: jason | ||
- name: test | ||
stringMatch: | ||
suffix: end | ||
prefix: / | ||
queryParameters: | ||
- name: debug | ||
stringMatch: | ||
exact: "yes" | ||
name: invalid-route | ||
route: | ||
cluster: invalid-route-dest |
Oops, something went wrong.