From 21d202d838ab718f525f15bd92765bcc8ea7b314 Mon Sep 17 00:00:00 2001 From: zhaonan Date: Tue, 31 Oct 2023 02:59:54 +0000 Subject: [PATCH] chore:fix http2_protocol_options warning message --- .../translate/out/default-resources.all.yaml | 18 ++++++++---------- .../translate/out/envoy-patch-policy.all.yaml | 9 ++++----- .../out/from-gateway-api-to-xds.all.json | 13 ++++++------- .../out/from-gateway-api-to-xds.all.yaml | 9 ++++----- .../out/from-gateway-api-to-xds.bootstrap.yaml | 9 ++++----- ...t-single-route-single-match-to-xds.all.json | 13 ++++++------- ...t-single-route-single-match-to-xds.all.yaml | 9 ++++----- ...le-route-single-match-to-xds.bootstrap.yaml | 9 ++++----- .../proxy/testdata/deployments/custom.yaml | 9 ++++----- .../custom_with_initcontainers.yaml | 9 ++++----- .../testdata/deployments/default-env.yaml | 9 ++++----- .../proxy/testdata/deployments/default.yaml | 9 ++++----- .../deployments/enable-prometheus.yaml | 9 ++++----- .../testdata/deployments/extension-env.yaml | 9 ++++----- .../proxy/testdata/deployments/volumes.yaml | 9 ++++----- internal/xds/bootstrap/bootstrap.yaml.tpl | 9 ++++----- .../testdata/custom-stats-matcher.yaml | 9 ++++----- .../bootstrap/testdata/disable-prometheus.yaml | 9 ++++----- .../bootstrap/testdata/enable-prometheus.yaml | 9 ++++----- .../xds/bootstrap/testdata/otel-metrics.yaml | 9 ++++----- internal/xds/translator/cluster_test.go | 1 - 21 files changed, 88 insertions(+), 110 deletions(-) diff --git a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml index bfc39f0543db..06afc6278401 100644 --- a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml @@ -98,13 +98,12 @@ envoyProxy: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: @@ -510,10 +509,6 @@ xds: name: prometheus_stats type: STATIC - connectTimeout: 10s - http2ProtocolOptions: - connectionKeepalive: - interval: 30s - timeout: 5s loadAssignment: clusterName: xds_cluster endpoints: @@ -550,7 +545,10 @@ xds: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: '@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicitHttpConfig: - http2ProtocolOptions: {} + http2ProtocolOptions: + connectionKeepalive: + interval: 30s + timeout: 5s listeners: - address: socketAddress: diff --git a/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml b/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml index e8682fc82616..fb054e518bb3 100644 --- a/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/envoy-patch-policy.all.yaml @@ -42,10 +42,6 @@ xds: name: prometheus_stats type: STATIC - connectTimeout: 10s - http2ProtocolOptions: - connectionKeepalive: - interval: 30s - timeout: 5s loadAssignment: clusterName: xds_cluster endpoints: @@ -82,7 +78,10 @@ xds: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: '@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicitHttpConfig: - http2ProtocolOptions: {} + http2ProtocolOptions: + connectionKeepalive: + interval: 30s + timeout: 5s listeners: - address: socketAddress: diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json index 2411af45366c..53fc117ef6e5 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json @@ -72,12 +72,6 @@ }, { "connectTimeout": "10s", - "http2ProtocolOptions": { - "connectionKeepalive": { - "interval": "30s", - "timeout": "5s" - } - }, "loadAssignment": { "clusterName": "xds_cluster", "endpoints": [ @@ -136,7 +130,12 @@ "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", "explicitHttpConfig": { - "http2ProtocolOptions": {} + "http2ProtocolOptions": { + "connectionKeepalive": { + "interval": "30s", + "timeout": "5s" + } + } } } } diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml index d02b1de377cd..40cee9b63a00 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml @@ -42,10 +42,6 @@ xds: name: prometheus_stats type: STATIC - connectTimeout: 10s - http2ProtocolOptions: - connectionKeepalive: - interval: 30s - timeout: 5s loadAssignment: clusterName: xds_cluster endpoints: @@ -82,7 +78,10 @@ xds: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: '@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicitHttpConfig: - http2ProtocolOptions: {} + http2ProtocolOptions: + connectionKeepalive: + interval: 30s + timeout: 5s listeners: - address: socketAddress: diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml index e57ac7b1c006..27b7bc7bb2a0 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.bootstrap.yaml @@ -41,10 +41,6 @@ xds: name: prometheus_stats type: STATIC - connectTimeout: 10s - http2ProtocolOptions: - connectionKeepalive: - interval: 30s - timeout: 5s loadAssignment: clusterName: xds_cluster endpoints: @@ -81,7 +77,10 @@ xds: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: '@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicitHttpConfig: - http2ProtocolOptions: {} + http2ProtocolOptions: + connectionKeepalive: + interval: 30s + timeout: 5s listeners: - address: socketAddress: diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json index 9adf09f0e52e..11c9c3261e2b 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json @@ -72,12 +72,6 @@ }, { "connectTimeout": "10s", - "http2ProtocolOptions": { - "connectionKeepalive": { - "interval": "30s", - "timeout": "5s" - } - }, "loadAssignment": { "clusterName": "xds_cluster", "endpoints": [ @@ -136,7 +130,12 @@ "envoy.extensions.upstreams.http.v3.HttpProtocolOptions": { "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions", "explicitHttpConfig": { - "http2ProtocolOptions": {} + "http2ProtocolOptions": { + "connectionKeepalive": { + "interval": "30s", + "timeout": "5s" + } + } } } } diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml index 1eb76aa4ce6e..c5470eebb98a 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml @@ -42,10 +42,6 @@ xds: name: prometheus_stats type: STATIC - connectTimeout: 10s - http2ProtocolOptions: - connectionKeepalive: - interval: 30s - timeout: 5s loadAssignment: clusterName: xds_cluster endpoints: @@ -82,7 +78,10 @@ xds: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: '@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicitHttpConfig: - http2ProtocolOptions: {} + http2ProtocolOptions: + connectionKeepalive: + interval: 30s + timeout: 5s listeners: - address: socketAddress: diff --git a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml index 169f3f954c63..e92c54f0dbc8 100644 --- a/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml +++ b/internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.bootstrap.yaml @@ -41,10 +41,6 @@ xds: name: prometheus_stats type: STATIC - connectTimeout: 10s - http2ProtocolOptions: - connectionKeepalive: - interval: 30s - timeout: 5s loadAssignment: clusterName: xds_cluster endpoints: @@ -81,7 +77,10 @@ xds: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: '@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicitHttpConfig: - http2ProtocolOptions: {} + http2ProtocolOptions: + connectionKeepalive: + interval: 30s + timeout: 5s listeners: - address: socketAddress: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml index c6958c0a5034..03c4ec7b993a 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom.yaml @@ -108,13 +108,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml index d9f4466506e0..b8aa8192d25a 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/custom_with_initcontainers.yaml @@ -108,13 +108,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml index e9621ada58d3..e6b1a8bd9cff 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default-env.yaml @@ -106,13 +106,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml index 14a29c0b4ec8..b735c371a131 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/default.yaml @@ -104,13 +104,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml index 9f296515f07a..7732de9f0651 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/enable-prometheus.yaml @@ -130,13 +130,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml index a9d3bd9e5e54..172511c44ac9 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/extension-env.yaml @@ -106,13 +106,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml index 002247177c5c..bdebfe89faf6 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/volumes.yaml @@ -106,13 +106,12 @@ spec: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/xds/bootstrap/bootstrap.yaml.tpl b/internal/xds/bootstrap/bootstrap.yaml.tpl index 61eea5c7eb8d..4828729a8161 100644 --- a/internal/xds/bootstrap/bootstrap.yaml.tpl +++ b/internal/xds/bootstrap/bootstrap.yaml.tpl @@ -141,13 +141,12 @@ static_resources: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml b/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml index 0360bde351b6..9fac5a316c51 100644 --- a/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml +++ b/internal/xds/bootstrap/testdata/custom-stats-matcher.yaml @@ -99,13 +99,12 @@ static_resources: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/xds/bootstrap/testdata/disable-prometheus.yaml b/internal/xds/bootstrap/testdata/disable-prometheus.yaml index d3bb7cc7d053..4cfe3d7d2b02 100644 --- a/internal/xds/bootstrap/testdata/disable-prometheus.yaml +++ b/internal/xds/bootstrap/testdata/disable-prometheus.yaml @@ -67,13 +67,12 @@ static_resources: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/xds/bootstrap/testdata/enable-prometheus.yaml b/internal/xds/bootstrap/testdata/enable-prometheus.yaml index 1f777d632936..667729dadf18 100644 --- a/internal/xds/bootstrap/testdata/enable-prometheus.yaml +++ b/internal/xds/bootstrap/testdata/enable-prometheus.yaml @@ -89,13 +89,12 @@ static_resources: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/xds/bootstrap/testdata/otel-metrics.yaml b/internal/xds/bootstrap/testdata/otel-metrics.yaml index 72c1e1d6c965..c4e4a6b750b9 100644 --- a/internal/xds/bootstrap/testdata/otel-metrics.yaml +++ b/internal/xds/bootstrap/testdata/otel-metrics.yaml @@ -92,13 +92,12 @@ static_resources: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": "type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions" explicit_http_config: - http2_protocol_options: {} + http2_protocol_options: + connection_keepalive: + interval: 30s + timeout: 5s name: xds_cluster type: STRICT_DNS - http2_protocol_options: - connection_keepalive: - interval: 30s - timeout: 5s transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/internal/xds/translator/cluster_test.go b/internal/xds/translator/cluster_test.go index 00ade71f4872..30235b6d4d6b 100644 --- a/internal/xds/translator/cluster_test.go +++ b/internal/xds/translator/cluster_test.go @@ -41,7 +41,6 @@ func TestBuildXdsCluster(t *testing.T) { require.Equal(t, bootstrapXdsCluster.TransportSocket, dynamicXdsCluster.TransportSocket) assert.True(t, proto.Equal(bootstrapXdsCluster.TransportSocket, dynamicXdsCluster.TransportSocket)) assert.True(t, proto.Equal(bootstrapXdsCluster.ConnectTimeout, dynamicXdsCluster.ConnectTimeout)) - assert.True(t, proto.Equal(bootstrapXdsCluster.TypedExtensionProtocolOptions[extensionOptionsKey], dynamicXdsCluster.TypedExtensionProtocolOptions[extensionOptionsKey])) } func TestBuildXdsClusterLoadAssignment(t *testing.T) {