From a19df32fa5eb8fb7e5486daeb97501f0e1c4b743 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 21 Dec 2023 13:41:05 -0700 Subject: [PATCH] NET-6942 - Replace usage of deprecated Envoy field envoy.config.cluster.v3.Cluster.http_protocol_options. (#20010) * NET-6942 - Replace usage of deprecated Envoy field envoy.config.cluster.v3.Cluster.http_protocol_options. * add changelog --- .changelog/20010.txt | 3 +++ command/connect/envoy/bootstrap_config.go | 9 ++++++- .../connect/envoy/bootstrap_config_test.go | 27 ++++++++++++++++--- .../testdata/envoy-readiness-probe.golden | 9 ++++++- .../ingress-gateway-address-specified.golden | 9 ++++++- .../ingress-gateway-no-auto-register.golden | 9 ++++++- .../testdata/ingress-gateway-nodemeta.golden | 9 ++++++- ...-register-with-service-and-proxy-id.golden | 9 ++++++- ...ister-with-service-without-proxy-id.golden | 9 ++++++- .../envoy/testdata/ingress-gateway.golden | 9 ++++++- .../prometheus-metrics-tls-ca-file.golden | 9 ++++++- .../prometheus-metrics-tls-ca-path.golden | 9 ++++++- .../envoy/testdata/prometheus-metrics.golden | 9 ++++++- test/integration/connect/envoy/main_test.go | 6 ++--- 14 files changed, 118 insertions(+), 17 deletions(-) create mode 100644 .changelog/20010.txt diff --git a/.changelog/20010.txt b/.changelog/20010.txt new file mode 100644 index 0000000000..c9e957cc43 --- /dev/null +++ b/.changelog/20010.txt @@ -0,0 +1,3 @@ +```release-note:improvement +xds: Replace usage of deprecated Envoy field `envoy.config.cluster.v3.Cluster.http_protocol_options` +``` \ No newline at end of file diff --git a/command/connect/envoy/bootstrap_config.go b/command/connect/envoy/bootstrap_config.go index f07c6817be..c99188bb14 100644 --- a/command/connect/envoy/bootstrap_config.go +++ b/command/connect/envoy/bootstrap_config.go @@ -653,7 +653,14 @@ func (c *BootstrapConfig) generateListenerConfig(args *BootstrapTplArgs, bindAdd "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "` + clusterName + `", "endpoints": [ diff --git a/command/connect/envoy/bootstrap_config_test.go b/command/connect/envoy/bootstrap_config_test.go index 445ae01fdc..1a782cdb39 100644 --- a/command/connect/envoy/bootstrap_config_test.go +++ b/command/connect/envoy/bootstrap_config_test.go @@ -21,7 +21,14 @@ const ( "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ @@ -47,7 +54,14 @@ const ( "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ @@ -73,7 +87,14 @@ const ( "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "prometheus_backend", "endpoints": [ diff --git a/command/connect/envoy/testdata/envoy-readiness-probe.golden b/command/connect/envoy/testdata/envoy-readiness-probe.golden index faa5e958f5..4fba6db590 100644 --- a/command/connect/envoy/testdata/envoy-readiness-probe.golden +++ b/command/connect/envoy/testdata/envoy-readiness-probe.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/ingress-gateway-address-specified.golden b/command/connect/envoy/testdata/ingress-gateway-address-specified.golden index ba4a341f9d..7ba3e2287c 100644 --- a/command/connect/envoy/testdata/ingress-gateway-address-specified.golden +++ b/command/connect/envoy/testdata/ingress-gateway-address-specified.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/ingress-gateway-no-auto-register.golden b/command/connect/envoy/testdata/ingress-gateway-no-auto-register.golden index f81ac13cdf..c866099ee0 100644 --- a/command/connect/envoy/testdata/ingress-gateway-no-auto-register.golden +++ b/command/connect/envoy/testdata/ingress-gateway-no-auto-register.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/ingress-gateway-nodemeta.golden b/command/connect/envoy/testdata/ingress-gateway-nodemeta.golden index 7983a070ec..39eae930d0 100644 --- a/command/connect/envoy/testdata/ingress-gateway-nodemeta.golden +++ b/command/connect/envoy/testdata/ingress-gateway-nodemeta.golden @@ -75,7 +75,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/ingress-gateway-register-with-service-and-proxy-id.golden b/command/connect/envoy/testdata/ingress-gateway-register-with-service-and-proxy-id.golden index 75b8b345ce..44a3c25c69 100644 --- a/command/connect/envoy/testdata/ingress-gateway-register-with-service-and-proxy-id.golden +++ b/command/connect/envoy/testdata/ingress-gateway-register-with-service-and-proxy-id.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/ingress-gateway-register-with-service-without-proxy-id.golden b/command/connect/envoy/testdata/ingress-gateway-register-with-service-without-proxy-id.golden index bf106f3426..a9e6f7e5fa 100644 --- a/command/connect/envoy/testdata/ingress-gateway-register-with-service-without-proxy-id.golden +++ b/command/connect/envoy/testdata/ingress-gateway-register-with-service-without-proxy-id.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/ingress-gateway.golden b/command/connect/envoy/testdata/ingress-gateway.golden index e270bec33f..e5c5e87593 100644 --- a/command/connect/envoy/testdata/ingress-gateway.golden +++ b/command/connect/envoy/testdata/ingress-gateway.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "self_admin", "endpoints": [ diff --git a/command/connect/envoy/testdata/prometheus-metrics-tls-ca-file.golden b/command/connect/envoy/testdata/prometheus-metrics-tls-ca-file.golden index 3f8fc4ce95..5754779b97 100644 --- a/command/connect/envoy/testdata/prometheus-metrics-tls-ca-file.golden +++ b/command/connect/envoy/testdata/prometheus-metrics-tls-ca-file.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "prometheus_backend", "endpoints": [ diff --git a/command/connect/envoy/testdata/prometheus-metrics-tls-ca-path.golden b/command/connect/envoy/testdata/prometheus-metrics-tls-ca-path.golden index 6ea679d723..c41b00fb2d 100644 --- a/command/connect/envoy/testdata/prometheus-metrics-tls-ca-path.golden +++ b/command/connect/envoy/testdata/prometheus-metrics-tls-ca-path.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "prometheus_backend", "endpoints": [ diff --git a/command/connect/envoy/testdata/prometheus-metrics.golden b/command/connect/envoy/testdata/prometheus-metrics.golden index e582cd16d7..1b31b48f8a 100644 --- a/command/connect/envoy/testdata/prometheus-metrics.golden +++ b/command/connect/envoy/testdata/prometheus-metrics.golden @@ -74,7 +74,14 @@ "ignore_health_on_host_removal": false, "connect_timeout": "5s", "type": "STATIC", - "http_protocol_options": {}, + "typed_extension_protocol_options": { + "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { + "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", + "explicit_http_config": { + "http_protocol_options": {} + } + } + }, "loadAssignment": { "clusterName": "prometheus_backend", "endpoints": [ diff --git a/test/integration/connect/envoy/main_test.go b/test/integration/connect/envoy/main_test.go index aa83bb6bbe..0268587f22 100644 --- a/test/integration/connect/envoy/main_test.go +++ b/test/integration/connect/envoy/main_test.go @@ -50,9 +50,9 @@ func TestEnvoy(t *testing.T) { caseDir := "CASE_DIR=" + tc t.Cleanup(func() { - if t.Failed() { - runCmd(t, "capture_logs", caseDir) - } + //if t.Failed() { + runCmd(t, "capture_logs", caseDir) + //} runCmd(t, "test_teardown", caseDir) })