From ebbb7c14d2076d9001e52898de0a379a405ba996 Mon Sep 17 00:00:00 2001 From: Matt Clement Date: Tue, 2 Aug 2022 11:30:15 -0400 Subject: [PATCH] Enable websocket upgrades for connect listeners --- agent/xds/listeners.go | 19 ++++++---- agent/xds/listeners_test.go | 6 ++++ ...oxy-with-chain-and-overrides.latest.golden | 7 +++- ...onnect-proxy-with-grpc-chain.latest.golden | 7 +++- ...onnect-proxy-with-http-chain.latest.golden | 7 +++- ...nnect-proxy-with-http2-chain.latest.golden | 7 +++- ...ustom-public-listener-http-2.latest.golden | 5 +++ .../custom-public-listener-http.latest.golden | 5 +++ .../custom-trace-listener.latest.golden | 7 +++- .../listeners/expose-checks.latest.golden | 7 +++- ...expose-paths-local-app-paths.latest.golden | 14 ++++++-- ...pose-paths-new-cluster-http2.latest.golden | 14 ++++++-- .../grpc-public-listener.latest.golden | 7 +++- .../http-listener-with-timeouts.latest.golden | 7 +++- ...http-public-listener-no-xfcc.latest.golden | 7 +++- .../http-public-listener.latest.golden | 7 +++- .../listeners/http-upstream.latest.golden | 7 +++- .../http2-public-listener.latest.golden | 7 +++- ...gress-grpc-multiple-services.latest.golden | 7 +++- ...gress-http-multiple-services.latest.golden | 14 ++++++-- ...itter-with-resolver-redirect.latest.golden | 7 +++- ...ith-grpc-single-tls-listener.latest.golden | 14 ++++++-- ...d-grpc-multiple-tls-listener.latest.golden | 14 ++++++-- ...th-http2-single-tls-listener.latest.golden | 14 ++++++-- ...h-sds-listener+service-level.latest.golden | 14 ++++++-- ...h-sds-listener-gw-level-http.latest.golden | 7 +++- ...s-service-level-mixed-no-tls.latest.golden | 14 ++++++-- ...gress-with-sds-service-level.latest.golden | 14 ++++++-- ...ess-with-single-tls-listener.latest.golden | 14 ++++++-- ...n-listeners-gateway-defaults.latest.golden | 35 ++++++++++++++++--- ...ess-with-tls-mixed-listeners.latest.golden | 14 ++++++-- ...-mixed-min-version-listeners.latest.golden | 21 +++++++++-- ...ed-services-http-with-router.latest.golden | 7 +++- ...xported-peered-services-http.latest.golden | 21 +++++++++-- ...itter-with-resolver-redirect.latest.golden | 7 +++- ...ting-gateway-service-subsets.latest.golden | 21 +++++++++-- ...arent-proxy-destination-http.latest.golden | 14 ++++++-- ...nsparent-proxy-http-upstream.latest.golden | 7 +++- ...ng-gateway-destinations-only.latest.golden | 14 ++++++-- ...-connect-proxy-opposite-meta.latest.golden | 5 +++ .../lambda-connect-proxy.latest.golden | 5 +++ ...teway-with-service-resolvers.latest.golden | 15 ++++++++ .../lambda-terminating-gateway.latest.golden | 5 +++ agent/xds/xds_protocol_helpers_test.go | 23 +++++++++--- 44 files changed, 425 insertions(+), 69 deletions(-) diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index b941798068a0..26739873594c 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -1644,13 +1644,13 @@ func (s *ResourceGenerator) makeFilterChainTerminatingGateway(cfgSnap *proxycfg. // HTTP filter to do intention checks here instead. timeout := 0 opts := listenerFilterOpts{ - protocol: tgtwyOpts.protocol, - filterName: fmt.Sprintf("%s.%s.%s.%s", tgtwyOpts.service.Name, tgtwyOpts.service.NamespaceOrDefault(), tgtwyOpts.service.PartitionOrDefault(), cfgSnap.Datacenter), - routeName: tgtwyOpts.cluster, // Set cluster name for route config since each will have its own - cluster: tgtwyOpts.cluster, - statPrefix: "upstream.", - routePath: "", - tracing: tracing, + protocol: tgtwyOpts.protocol, + filterName: fmt.Sprintf("%s.%s.%s.%s", tgtwyOpts.service.Name, tgtwyOpts.service.NamespaceOrDefault(), tgtwyOpts.service.PartitionOrDefault(), cfgSnap.Datacenter), + routeName: tgtwyOpts.cluster, // Set cluster name for route config since each will have its own + cluster: tgtwyOpts.cluster, + statPrefix: "upstream.", + routePath: "", + tracing: tracing, requestTimeoutMs: &timeout, } @@ -2209,6 +2209,11 @@ func makeHTTPFilter(opts listenerFilterOpts) (*envoy_listener_v3.Filter, error) HttpFilters: []*envoy_http_v3.HttpFilter{ router, }, + UpgradeConfigs: []*envoy_http_v3.HttpConnectionManager_UpgradeConfig{ + { + UpgradeType: "websocket", + }, + }, Tracing: &envoy_http_v3.HttpConnectionManager_Tracing{ // Don't trace any requests by default unless the client application // explicitly propagates trace headers that indicate this should be diff --git a/agent/xds/listeners_test.go b/agent/xds/listeners_test.go index df8d1e2ed5d1..902397b0415f 100644 --- a/agent/xds/listeners_test.go +++ b/agent/xds/listeners_test.go @@ -961,6 +961,12 @@ const customHTTPListenerJSONTpl = `{ "name": "envoy.filters.http.router" } ], + "upgrade_configs": [ + { + "upgrade_type": "websocket" + } + ], + "route_config": { "name": "public_listener", "virtual_hosts": [ diff --git a/agent/xds/testdata/listeners/connect-proxy-with-chain-and-overrides.latest.golden b/agent/xds/testdata/listeners/connect-proxy-with-chain-and-overrides.latest.golden index 4e524021f8b2..33a5019b0fa2 100644 --- a/agent/xds/testdata/listeners/connect-proxy-with-chain-and-overrides.latest.golden +++ b/agent/xds/testdata/listeners/connect-proxy-with-chain-and-overrides.latest.golden @@ -55,7 +55,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/connect-proxy-with-grpc-chain.latest.golden b/agent/xds/testdata/listeners/connect-proxy-with-grpc-chain.latest.golden index 4e524021f8b2..33a5019b0fa2 100644 --- a/agent/xds/testdata/listeners/connect-proxy-with-grpc-chain.latest.golden +++ b/agent/xds/testdata/listeners/connect-proxy-with-grpc-chain.latest.golden @@ -55,7 +55,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/connect-proxy-with-http-chain.latest.golden b/agent/xds/testdata/listeners/connect-proxy-with-http-chain.latest.golden index 0eed52477d62..dd425356f85f 100644 --- a/agent/xds/testdata/listeners/connect-proxy-with-http-chain.latest.golden +++ b/agent/xds/testdata/listeners/connect-proxy-with-http-chain.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/connect-proxy-with-http2-chain.latest.golden b/agent/xds/testdata/listeners/connect-proxy-with-http2-chain.latest.golden index 56d9ffd88151..03a25880fe38 100644 --- a/agent/xds/testdata/listeners/connect-proxy-with-http2-chain.latest.golden +++ b/agent/xds/testdata/listeners/connect-proxy-with-http2-chain.latest.golden @@ -42,7 +42,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/custom-public-listener-http-2.latest.golden b/agent/xds/testdata/listeners/custom-public-listener-http-2.latest.golden index 4a44d3f6f1f4..1e38b89a0c0d 100644 --- a/agent/xds/testdata/listeners/custom-public-listener-http-2.latest.golden +++ b/agent/xds/testdata/listeners/custom-public-listener-http-2.latest.golden @@ -51,6 +51,11 @@ { "name": "envoy.filters.http.router" } + ], + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } ] } } diff --git a/agent/xds/testdata/listeners/custom-public-listener-http.latest.golden b/agent/xds/testdata/listeners/custom-public-listener-http.latest.golden index 4a44d3f6f1f4..1e38b89a0c0d 100644 --- a/agent/xds/testdata/listeners/custom-public-listener-http.latest.golden +++ b/agent/xds/testdata/listeners/custom-public-listener-http.latest.golden @@ -51,6 +51,11 @@ { "name": "envoy.filters.http.router" } + ], + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } ] } } diff --git a/agent/xds/testdata/listeners/custom-trace-listener.latest.golden b/agent/xds/testdata/listeners/custom-trace-listener.latest.golden index 95c1aa63c63c..0a5304d02b51 100644 --- a/agent/xds/testdata/listeners/custom-trace-listener.latest.golden +++ b/agent/xds/testdata/listeners/custom-trace-listener.latest.golden @@ -139,7 +139,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/expose-checks.latest.golden b/agent/xds/testdata/listeners/expose-checks.latest.golden index 518285040d05..ad9266723a74 100644 --- a/agent/xds/testdata/listeners/expose-checks.latest.golden +++ b/agent/xds/testdata/listeners/expose-checks.latest.golden @@ -67,7 +67,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/expose-paths-local-app-paths.latest.golden b/agent/xds/testdata/listeners/expose-paths-local-app-paths.latest.golden index cb7b0d46e7db..2acbe64b60e8 100644 --- a/agent/xds/testdata/listeners/expose-paths-local-app-paths.latest.golden +++ b/agent/xds/testdata/listeners/expose-paths-local-app-paths.latest.golden @@ -51,7 +51,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -109,7 +114,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/expose-paths-new-cluster-http2.latest.golden b/agent/xds/testdata/listeners/expose-paths-new-cluster-http2.latest.golden index 84ef190ad931..b2957d3f5562 100644 --- a/agent/xds/testdata/listeners/expose-paths-new-cluster-http2.latest.golden +++ b/agent/xds/testdata/listeners/expose-paths-new-cluster-http2.latest.golden @@ -54,7 +54,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -112,7 +117,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/grpc-public-listener.latest.golden b/agent/xds/testdata/listeners/grpc-public-listener.latest.golden index 04493913f9cd..8b291b42c607 100644 --- a/agent/xds/testdata/listeners/grpc-public-listener.latest.golden +++ b/agent/xds/testdata/listeners/grpc-public-listener.latest.golden @@ -134,7 +134,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/http-listener-with-timeouts.latest.golden b/agent/xds/testdata/listeners/http-listener-with-timeouts.latest.golden index a3c58e2ab848..e1dc747eb575 100644 --- a/agent/xds/testdata/listeners/http-listener-with-timeouts.latest.golden +++ b/agent/xds/testdata/listeners/http-listener-with-timeouts.latest.golden @@ -120,7 +120,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/http-public-listener-no-xfcc.latest.golden b/agent/xds/testdata/listeners/http-public-listener-no-xfcc.latest.golden index 2ba00f2cecd0..bb8b4f747ac2 100644 --- a/agent/xds/testdata/listeners/http-public-listener-no-xfcc.latest.golden +++ b/agent/xds/testdata/listeners/http-public-listener-no-xfcc.latest.golden @@ -110,7 +110,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/http-public-listener.latest.golden b/agent/xds/testdata/listeners/http-public-listener.latest.golden index c7a70d337137..f0a4a7494d59 100644 --- a/agent/xds/testdata/listeners/http-public-listener.latest.golden +++ b/agent/xds/testdata/listeners/http-public-listener.latest.golden @@ -118,7 +118,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/http-upstream.latest.golden b/agent/xds/testdata/listeners/http-upstream.latest.golden index 5db6ce2a9661..5035fcc65f6e 100644 --- a/agent/xds/testdata/listeners/http-upstream.latest.golden +++ b/agent/xds/testdata/listeners/http-upstream.latest.golden @@ -52,7 +52,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/http2-public-listener.latest.golden b/agent/xds/testdata/listeners/http2-public-listener.latest.golden index cf6f0150aa37..afb44f601130 100644 --- a/agent/xds/testdata/listeners/http2-public-listener.latest.golden +++ b/agent/xds/testdata/listeners/http2-public-listener.latest.golden @@ -121,7 +121,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-grpc-multiple-services.latest.golden b/agent/xds/testdata/listeners/ingress-grpc-multiple-services.latest.golden index abad991957b5..051c66746dee 100644 --- a/agent/xds/testdata/listeners/ingress-grpc-multiple-services.latest.golden +++ b/agent/xds/testdata/listeners/ingress-grpc-multiple-services.latest.golden @@ -55,7 +55,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/ingress-http-multiple-services.latest.golden b/agent/xds/testdata/listeners/ingress-http-multiple-services.latest.golden index bcdf29c64326..dc8ab53ad886 100644 --- a/agent/xds/testdata/listeners/ingress-http-multiple-services.latest.golden +++ b/agent/xds/testdata/listeners/ingress-http-multiple-services.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -85,7 +90,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/ingress-splitter-with-resolver-redirect.latest.golden b/agent/xds/testdata/listeners/ingress-splitter-with-resolver-redirect.latest.golden index ae2f68556e15..c149b6e64551 100644 --- a/agent/xds/testdata/listeners/ingress-splitter-with-resolver-redirect.latest.golden +++ b/agent/xds/testdata/listeners/ingress-splitter-with-resolver-redirect.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/ingress-with-grpc-single-tls-listener.latest.golden b/agent/xds/testdata/listeners/ingress-with-grpc-single-tls-listener.latest.golden index e4a769066ad7..aae651f30320 100644 --- a/agent/xds/testdata/listeners/ingress-with-grpc-single-tls-listener.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-grpc-single-tls-listener.latest.golden @@ -55,7 +55,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -117,7 +122,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-http2-and-grpc-multiple-tls-listener.latest.golden b/agent/xds/testdata/listeners/ingress-with-http2-and-grpc-multiple-tls-listener.latest.golden index 774d0defabb4..588ea9a910e9 100644 --- a/agent/xds/testdata/listeners/ingress-with-http2-and-grpc-multiple-tls-listener.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-http2-and-grpc-multiple-tls-listener.latest.golden @@ -55,7 +55,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -135,7 +140,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-http2-single-tls-listener.latest.golden b/agent/xds/testdata/listeners/ingress-with-http2-single-tls-listener.latest.golden index 03bc6bc63399..b9e0d16bc2c5 100644 --- a/agent/xds/testdata/listeners/ingress-with-http2-single-tls-listener.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-http2-single-tls-listener.latest.golden @@ -42,7 +42,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -91,7 +96,12 @@ }, "http2ProtocolOptions": { - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-sds-listener+service-level.latest.golden b/agent/xds/testdata/listeners/ingress-with-sds-listener+service-level.latest.golden index 7aa0d5d210a9..62b0c7adbffe 100644 --- a/agent/xds/testdata/listeners/ingress-with-sds-listener+service-level.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-sds-listener+service-level.latest.golden @@ -44,7 +44,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -112,7 +117,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-sds-listener-gw-level-http.latest.golden b/agent/xds/testdata/listeners/ingress-with-sds-listener-gw-level-http.latest.golden index de06deebade4..01e9ce4f2f56 100644 --- a/agent/xds/testdata/listeners/ingress-with-sds-listener-gw-level-http.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-sds-listener-gw-level-http.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-sds-service-level-mixed-no-tls.latest.golden b/agent/xds/testdata/listeners/ingress-with-sds-service-level-mixed-no-tls.latest.golden index 3faaddb8a2cc..068d508fd6c0 100644 --- a/agent/xds/testdata/listeners/ingress-with-sds-service-level-mixed-no-tls.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-sds-service-level-mixed-no-tls.latest.golden @@ -44,7 +44,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -112,7 +117,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/ingress-with-sds-service-level.latest.golden b/agent/xds/testdata/listeners/ingress-with-sds-service-level.latest.golden index c2ee37ccb197..7278995791cc 100644 --- a/agent/xds/testdata/listeners/ingress-with-sds-service-level.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-sds-service-level.latest.golden @@ -44,7 +44,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -117,7 +122,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-single-tls-listener.latest.golden b/agent/xds/testdata/listeners/ingress-with-single-tls-listener.latest.golden index 22edaf577d14..13495a35033c 100644 --- a/agent/xds/testdata/listeners/ingress-with-single-tls-listener.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-single-tls-listener.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -85,7 +90,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-tls-min-version-listeners-gateway-defaults.latest.golden b/agent/xds/testdata/listeners/ingress-with-tls-min-version-listeners-gateway-defaults.latest.golden index 7eac1ef3d6a7..90cafd66ece4 100644 --- a/agent/xds/testdata/listeners/ingress-with-tls-min-version-listeners-gateway-defaults.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-tls-min-version-listeners-gateway-defaults.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -115,7 +120,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -191,7 +201,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -267,7 +282,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -343,7 +363,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/ingress-with-tls-mixed-listeners.latest.golden b/agent/xds/testdata/listeners/ingress-with-tls-mixed-listeners.latest.golden index 8e7894f8d3a5..9db6913ad3b7 100644 --- a/agent/xds/testdata/listeners/ingress-with-tls-mixed-listeners.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-tls-mixed-listeners.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -115,7 +120,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/ingress-with-tls-mixed-min-version-listeners.latest.golden b/agent/xds/testdata/listeners/ingress-with-tls-mixed-min-version-listeners.latest.golden index 802f47f4df36..72b33de8c15c 100644 --- a/agent/xds/testdata/listeners/ingress-with-tls-mixed-min-version-listeners.latest.golden +++ b/agent/xds/testdata/listeners/ingress-with-tls-mixed-min-version-listeners.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -115,7 +120,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -191,7 +201,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http-with-router.latest.golden b/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http-with-router.latest.golden index 1ed34afb91e5..cedfc71f1264 100644 --- a/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http-with-router.latest.golden +++ b/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http-with-router.latest.golden @@ -52,7 +52,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http.latest.golden b/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http.latest.golden index acb312116d12..44593a662b83 100644 --- a/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http.latest.golden +++ b/agent/xds/testdata/listeners/mesh-gateway-with-exported-peered-services-http.latest.golden @@ -52,7 +52,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -142,7 +147,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -232,7 +242,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/splitter-with-resolver-redirect.latest.golden b/agent/xds/testdata/listeners/splitter-with-resolver-redirect.latest.golden index 0eed52477d62..dd425356f85f 100644 --- a/agent/xds/testdata/listeners/splitter-with-resolver-redirect.latest.golden +++ b/agent/xds/testdata/listeners/splitter-with-resolver-redirect.latest.golden @@ -39,7 +39,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/terminating-gateway-service-subsets.latest.golden b/agent/xds/testdata/listeners/terminating-gateway-service-subsets.latest.golden index 003860ddcd76..dfdf59732e9b 100644 --- a/agent/xds/testdata/listeners/terminating-gateway-service-subsets.latest.golden +++ b/agent/xds/testdata/listeners/terminating-gateway-service-subsets.latest.golden @@ -223,7 +223,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -305,7 +310,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -387,7 +397,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/listeners/transparent-proxy-destination-http.latest.golden b/agent/xds/testdata/listeners/transparent-proxy-destination-http.latest.golden index b621f19ddc80..1ccd72610362 100644 --- a/agent/xds/testdata/listeners/transparent-proxy-destination-http.latest.golden +++ b/agent/xds/testdata/listeners/transparent-proxy-destination-http.latest.golden @@ -67,7 +67,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] @@ -103,7 +108,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/transparent-proxy-http-upstream.latest.golden b/agent/xds/testdata/listeners/transparent-proxy-http-upstream.latest.golden index c07c7050a2bb..77292a82a393 100644 --- a/agent/xds/testdata/listeners/transparent-proxy-http-upstream.latest.golden +++ b/agent/xds/testdata/listeners/transparent-proxy-http-upstream.latest.golden @@ -89,7 +89,12 @@ "randomSampling": { } - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ] diff --git a/agent/xds/testdata/listeners/transparent-proxy-terminating-gateway-destinations-only.latest.golden b/agent/xds/testdata/listeners/transparent-proxy-terminating-gateway-destinations-only.latest.golden index a56501250ef3..174ebef13332 100644 --- a/agent/xds/testdata/listeners/transparent-proxy-terminating-gateway-destinations-only.latest.golden +++ b/agent/xds/testdata/listeners/transparent-proxy-terminating-gateway-destinations-only.latest.golden @@ -115,7 +115,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], @@ -413,7 +418,12 @@ "chain": true, "dns": true, "uri": true - } + }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ] } } ], diff --git a/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy-opposite-meta.latest.golden b/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy-opposite-meta.latest.golden index d9c68ffdb6eb..6cc546f1cd09 100644 --- a/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy-opposite-meta.latest.golden +++ b/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy-opposite-meta.latest.golden @@ -61,6 +61,11 @@ } }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ], "stripAnyHostPort": true } } diff --git a/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy.latest.golden b/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy.latest.golden index 7d8c98cb50aa..f1144f6e8eed 100644 --- a/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy.latest.golden +++ b/agent/xds/testdata/serverless_plugin/listeners/lambda-connect-proxy.latest.golden @@ -61,6 +61,11 @@ } }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ], "stripAnyHostPort": true } } diff --git a/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway-with-service-resolvers.latest.golden b/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway-with-service-resolvers.latest.golden index 59000983e22e..972070279498 100644 --- a/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway-with-service-resolvers.latest.golden +++ b/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway-with-service-resolvers.latest.golden @@ -178,6 +178,11 @@ "dns": true, "uri": true }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ], "stripAnyHostPort": true } } @@ -269,6 +274,11 @@ "dns": true, "uri": true }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ], "stripAnyHostPort": true } } @@ -414,6 +424,11 @@ "dns": true, "uri": true }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ], "stripAnyHostPort": true } } diff --git a/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway.latest.golden b/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway.latest.golden index 732272c3cb3c..87a3e6511ac8 100644 --- a/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway.latest.golden +++ b/agent/xds/testdata/serverless_plugin/listeners/lambda-terminating-gateway.latest.golden @@ -232,6 +232,11 @@ "dns": true, "uri": true }, + "upgradeConfigs": [ + { + "upgradeType": "websocket" + } + ], "stripAnyHostPort": true } } diff --git a/agent/xds/xds_protocol_helpers_test.go b/agent/xds/xds_protocol_helpers_test.go index e5ea3d065691..54a627764b7c 100644 --- a/agent/xds/xds_protocol_helpers_test.go +++ b/agent/xds/xds_protocol_helpers_test.go @@ -416,7 +416,7 @@ func makeTestCluster(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName st EdsClusterConfig: &envoy_cluster_v3.Cluster_EdsClusterConfig{ EdsConfig: xdsNewADSConfig(), }, - CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ + CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ Thresholds: []*envoy_cluster_v3.CircuitBreakers_Thresholds{ &envoy_cluster_v3.CircuitBreakers_Thresholds{ MaxConnections: makeUint32Value(4096), @@ -440,7 +440,7 @@ func makeTestCluster(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName st EdsClusterConfig: &envoy_cluster_v3.Cluster_EdsClusterConfig{ EdsConfig: xdsNewADSConfig(), }, - CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ + CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ Thresholds: []*envoy_cluster_v3.CircuitBreakers_Thresholds{ &envoy_cluster_v3.CircuitBreakers_Thresholds{ MaxConnections: makeUint32Value(4096), @@ -464,7 +464,7 @@ func makeTestCluster(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName st EdsClusterConfig: &envoy_cluster_v3.Cluster_EdsClusterConfig{ EdsConfig: xdsNewADSConfig(), }, - CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ + CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ Thresholds: []*envoy_cluster_v3.CircuitBreakers_Thresholds{ &envoy_cluster_v3.CircuitBreakers_Thresholds{ MaxConnections: makeUint32Value(4096), @@ -503,7 +503,7 @@ func makeTestCluster(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName st EdsClusterConfig: &envoy_cluster_v3.Cluster_EdsClusterConfig{ EdsConfig: xdsNewADSConfig(), }, - CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ + CircuitBreakers: &envoy_cluster_v3.CircuitBreakers{ Thresholds: []*envoy_cluster_v3.CircuitBreakers_Thresholds{ &envoy_cluster_v3.CircuitBreakers_Thresholds{ MaxConnections: makeUint32Value(4096), @@ -673,6 +673,11 @@ func makeTestListener(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName s HttpFilters: []*envoy_http_v3.HttpFilter{ xdsNewHttpFilter(t, "envoy.filters.http.router", &envoy_http_router_v3.Router{}), }, + UpgradeConfigs: []*envoy_http_v3.HttpConnectionManager_UpgradeConfig{ + { + UpgradeType: "websocket", + }, + }, RouteSpecifier: &envoy_http_v3.HttpConnectionManager_RouteConfig{ RouteConfig: makeTestRoute(t, "http2:db:inline"), }, @@ -698,6 +703,11 @@ func makeTestListener(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName s HttpFilters: []*envoy_http_v3.HttpFilter{ xdsNewHttpFilter(t, "envoy.filters.http.router", &envoy_http_router_v3.Router{}), }, + UpgradeConfigs: []*envoy_http_v3.HttpConnectionManager_UpgradeConfig{ + { + UpgradeType: "websocket", + }, + }, RouteSpecifier: &envoy_http_v3.HttpConnectionManager_Rds{ Rds: &envoy_http_v3.Rds{ RouteConfigName: "db", @@ -726,6 +736,11 @@ func makeTestListener(t *testing.T, snap *proxycfg.ConfigSnapshot, fixtureName s HttpFilters: []*envoy_http_v3.HttpFilter{ xdsNewHttpFilter(t, "envoy.filters.http.router", &envoy_http_router_v3.Router{}), }, + UpgradeConfigs: []*envoy_http_v3.HttpConnectionManager_UpgradeConfig{ + { + UpgradeType: "websocket", + }, + }, RouteSpecifier: &envoy_http_v3.HttpConnectionManager_Rds{ Rds: &envoy_http_v3.Rds{ RouteConfigName: "db",