diff --git a/.dockerignore b/.dockerignore index c57a17991b8f..ee59c60405f3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ /* +!/build_envoy !/ci !/configs/google-vrp !/configs/*yaml diff --git a/api/bazel/repository_locations.bzl b/api/bazel/repository_locations.bzl index d72069046b85..f0173e58946e 100644 --- a/api/bazel/repository_locations.bzl +++ b/api/bazel/repository_locations.bzl @@ -22,14 +22,15 @@ REPOSITORY_LOCATIONS_SPEC = dict( use_category = ["api"], ), com_github_cncf_udpa = dict( - project_name = "Universal Data Plane API", - project_desc = "Universal Data Plane API Working Group (UDPA-WG)", + project_name = "xDS API", + project_desc = "xDS API Working Group (xDS-WG)", project_url = "https://github.com/cncf/udpa", - version = "0.0.1", - sha256 = "83a7dcc316d741031f34c0409021432b74a39c4811845a177133f02f948fe2d8", + # During the UDPA -> xDS migration, we aren't working with releases. + version = "5459f2c994033b0afed7e4a70ac7e90c90c1ffee", + sha256 = "c1f5c2438cf725b5f66aa4210dbc4bb691020c5ed4f64d2bc6638b06a11482f1", strip_prefix = "udpa-{version}", - urls = ["https://github.com/cncf/udpa/archive/v{version}.tar.gz"], - release_date = "2020-06-29", + urls = ["https://github.com/cncf/udpa/archive/{version}.tar.gz"], + release_date = "2020-11-20", use_category = ["api"], ), com_github_openzipkin_zipkinapi = dict( diff --git a/api/envoy/config/bootstrap/v3/BUILD b/api/envoy/config/bootstrap/v3/BUILD index 634d71245fdd..0ea9120c988f 100644 --- a/api/envoy/config/bootstrap/v3/BUILD +++ b/api/envoy/config/bootstrap/v3/BUILD @@ -17,6 +17,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/bootstrap/v3/bootstrap.proto b/api/envoy/config/bootstrap/v3/bootstrap.proto index 9581fd6ca772..f18dd94c19cd 100644 --- a/api/envoy/config/bootstrap/v3/bootstrap.proto +++ b/api/envoy/config/bootstrap/v3/bootstrap.proto @@ -20,7 +20,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/migrate.proto"; @@ -79,7 +79,7 @@ message Bootstrap { // Resource locator for listener collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator lds_resources_locator = 5; + xds.core.v3.ResourceLocator lds_resources_locator = 5; // All post-bootstrap :ref:`Cluster ` definitions are // provided by a single :ref:`CDS ` @@ -88,7 +88,7 @@ message Bootstrap { // Resource locator for cluster collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator cds_resources_locator = 6; + xds.core.v3.ResourceLocator cds_resources_locator = 6; // A single :ref:`ADS ` source may be optionally // specified. This must have :ref:`api_type @@ -110,7 +110,7 @@ message Bootstrap { // A list of :ref:`Node ` field names // that will be included in the context parameters of the effective - // *UdpaResourceLocator* that is sent in a discovery request when resource + // *XdsResourceLocator* that is sent in a discovery request when resource // locators are used for LDS/CDS. Any non-string field will have its JSON // encoding set as the context parameter value, with the exception of // metadata, which will be flattened (see example below). The supported field @@ -248,9 +248,9 @@ message Bootstrap { repeated FatalAction fatal_actions = 28; // Configuration sources that will participate in - // *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as + // *xds.core.v3.ResourceLocator* authority resolution. The algorithm is as // follows: - // 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call + // 1. The authority field is taken from the *xds.core.v3.ResourceLocator*, call // this *resource_authority*. // 2. *resource_authority* is compared against the authorities in any peer // *ConfigSource*. The peer *ConfigSource* is the configuration source @@ -266,7 +266,7 @@ message Bootstrap { // [#not-implemented-hide:] repeated core.v3.ConfigSource config_sources = 22; - // Default configuration source for *udpa.core.v1.ResourceLocator* if all + // Default configuration source for *xds.core.v3.ResourceLocator* if all // other resolution fails. // [#not-implemented-hide:] core.v3.ConfigSource default_config_source = 23; @@ -515,7 +515,7 @@ message RuntimeLayer { // Resource locator for RTDS layer. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rtds_resource_locator = 3 + xds.core.v3.ResourceLocator rtds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; // RTDS configuration source. diff --git a/api/envoy/config/bootstrap/v4alpha/BUILD b/api/envoy/config/bootstrap/v4alpha/BUILD index ab20e593190d..9e2017279c9d 100644 --- a/api/envoy/config/bootstrap/v4alpha/BUILD +++ b/api/envoy/config/bootstrap/v4alpha/BUILD @@ -16,6 +16,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v4alpha:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/bootstrap/v4alpha/bootstrap.proto b/api/envoy/config/bootstrap/v4alpha/bootstrap.proto index 1fe40d6b9607..04dcc5200964 100644 --- a/api/envoy/config/bootstrap/v4alpha/bootstrap.proto +++ b/api/envoy/config/bootstrap/v4alpha/bootstrap.proto @@ -19,7 +19,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/security.proto"; @@ -77,7 +77,7 @@ message Bootstrap { // Resource locator for listener collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator lds_resources_locator = 5; + xds.core.v3.ResourceLocator lds_resources_locator = 5; // All post-bootstrap :ref:`Cluster ` definitions are // provided by a single :ref:`CDS ` @@ -86,7 +86,7 @@ message Bootstrap { // Resource locator for cluster collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator cds_resources_locator = 6; + xds.core.v3.ResourceLocator cds_resources_locator = 6; // A single :ref:`ADS ` source may be optionally // specified. This must have :ref:`api_type @@ -108,7 +108,7 @@ message Bootstrap { // A list of :ref:`Node ` field names // that will be included in the context parameters of the effective - // *UdpaResourceLocator* that is sent in a discovery request when resource + // *XdsResourceLocator* that is sent in a discovery request when resource // locators are used for LDS/CDS. Any non-string field will have its JSON // encoding set as the context parameter value, with the exception of // metadata, which will be flattened (see example below). The supported field @@ -234,9 +234,9 @@ message Bootstrap { repeated FatalAction fatal_actions = 28; // Configuration sources that will participate in - // *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as + // *xds.core.v3.ResourceLocator* authority resolution. The algorithm is as // follows: - // 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call + // 1. The authority field is taken from the *xds.core.v3.ResourceLocator*, call // this *resource_authority*. // 2. *resource_authority* is compared against the authorities in any peer // *ConfigSource*. The peer *ConfigSource* is the configuration source @@ -252,7 +252,7 @@ message Bootstrap { // [#not-implemented-hide:] repeated core.v4alpha.ConfigSource config_sources = 22; - // Default configuration source for *udpa.core.v1.ResourceLocator* if all + // Default configuration source for *xds.core.v3.ResourceLocator* if all // other resolution fails. // [#not-implemented-hide:] core.v4alpha.ConfigSource default_config_source = 23; @@ -511,7 +511,7 @@ message RuntimeLayer { // Resource locator for RTDS layer. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rtds_resource_locator = 3; + xds.core.v3.ResourceLocator rtds_resource_locator = 3; } // RTDS configuration source. diff --git a/api/envoy/config/cluster/v3/BUILD b/api/envoy/config/cluster/v3/BUILD index 2a54d5d83be8..92530e0fa197 100644 --- a/api/envoy/config/cluster/v3/BUILD +++ b/api/envoy/config/cluster/v3/BUILD @@ -13,6 +13,6 @@ api_proto_package( "//envoy/config/endpoint/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/cluster/v3/cluster.proto b/api/envoy/config/cluster/v3/cluster.proto index 8e039a1f16fe..130887c76a10 100644 --- a/api/envoy/config/cluster/v3/cluster.proto +++ b/api/envoy/config/cluster/v3/cluster.proto @@ -19,8 +19,8 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/collection_entry.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/migrate.proto"; @@ -39,7 +39,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Cluster list collections. Entries are *Cluster* resources or references. // [#not-implemented-hide:] message ClusterCollection { - udpa.core.v1.CollectionEntry entries = 1; + xds.core.v3.CollectionEntry entries = 1; } // Configuration for a single upstream cluster. @@ -192,7 +192,7 @@ message Cluster { // Resource locator for EDS. This is mutually exclusive to *service_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator eds_resource_locator = 3 + xds.core.v3.ResourceLocator eds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; } diff --git a/api/envoy/config/cluster/v4alpha/BUILD b/api/envoy/config/cluster/v4alpha/BUILD index aab9f272f0d3..2bac8db17256 100644 --- a/api/envoy/config/cluster/v4alpha/BUILD +++ b/api/envoy/config/cluster/v4alpha/BUILD @@ -12,6 +12,6 @@ api_proto_package( "//envoy/config/endpoint/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/cluster/v4alpha/cluster.proto b/api/envoy/config/cluster/v4alpha/cluster.proto index 0ad15668e6cf..8f198f596532 100644 --- a/api/envoy/config/cluster/v4alpha/cluster.proto +++ b/api/envoy/config/cluster/v4alpha/cluster.proto @@ -19,8 +19,8 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/collection_entry.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/security.proto"; @@ -41,7 +41,7 @@ message ClusterCollection { option (udpa.annotations.versioning).previous_message_type = "envoy.config.cluster.v3.ClusterCollection"; - udpa.core.v1.CollectionEntry entries = 1; + xds.core.v3.CollectionEntry entries = 1; } // Configuration for a single upstream cluster. @@ -195,7 +195,7 @@ message Cluster { // Resource locator for EDS. This is mutually exclusive to *service_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator eds_resource_locator = 3; + xds.core.v3.ResourceLocator eds_resource_locator = 3; } } diff --git a/api/envoy/config/core/v3/BUILD b/api/envoy/config/core/v3/BUILD index 4691a421939a..72e10b6df844 100644 --- a/api/envoy/config/core/v3/BUILD +++ b/api/envoy/config/core/v3/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/type/matcher/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/core/v3/config_source.proto b/api/envoy/config/core/v3/config_source.proto index 72837bb3bee1..1ddaf6df8d09 100644 --- a/api/envoy/config/core/v3/config_source.proto +++ b/api/envoy/config/core/v3/config_source.proto @@ -7,7 +7,7 @@ import "envoy/config/core/v3/grpc_service.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/authority.proto"; +import "xds/core/v3/authority.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/status.proto"; @@ -153,11 +153,11 @@ message ConfigSource { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.ConfigSource"; // Authorities that this config source may be used for. An authority specified - // in a *udpa.core.v1.ResourceLocator* is resolved to a *ConfigSource* prior + // in a *xds.core.v3.ResourceLocator* is resolved to a *ConfigSource* prior // to configuration fetch. This field provides the association between // authority name and configuration source. // [#not-implemented-hide:] - repeated udpa.core.v1.Authority authorities = 7; + repeated xds.core.v3.Authority authorities = 7; oneof config_source_specifier { option (validate.required) = true; diff --git a/api/envoy/config/core/v4alpha/BUILD b/api/envoy/config/core/v4alpha/BUILD index 77ef526ee759..c9e435fda9a9 100644 --- a/api/envoy/config/core/v4alpha/BUILD +++ b/api/envoy/config/core/v4alpha/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/type/matcher/v4alpha:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/core/v4alpha/config_source.proto b/api/envoy/config/core/v4alpha/config_source.proto index 72b4f0357439..f122d5d0811f 100644 --- a/api/envoy/config/core/v4alpha/config_source.proto +++ b/api/envoy/config/core/v4alpha/config_source.proto @@ -7,7 +7,7 @@ import "envoy/config/core/v4alpha/grpc_service.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/authority.proto"; +import "xds/core/v3/authority.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/status.proto"; @@ -155,11 +155,11 @@ message ConfigSource { option (udpa.annotations.versioning).previous_message_type = "envoy.config.core.v3.ConfigSource"; // Authorities that this config source may be used for. An authority specified - // in a *udpa.core.v1.ResourceLocator* is resolved to a *ConfigSource* prior + // in a *xds.core.v3.ResourceLocator* is resolved to a *ConfigSource* prior // to configuration fetch. This field provides the association between // authority name and configuration source. // [#not-implemented-hide:] - repeated udpa.core.v1.Authority authorities = 7; + repeated xds.core.v3.Authority authorities = 7; oneof config_source_specifier { option (validate.required) = true; diff --git a/api/envoy/config/listener/v3/BUILD b/api/envoy/config/listener/v3/BUILD index 9a397028bd58..31cd086745a8 100644 --- a/api/envoy/config/listener/v3/BUILD +++ b/api/envoy/config/listener/v3/BUILD @@ -13,6 +13,6 @@ api_proto_package( "//envoy/config/listener/v2:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/listener/v3/listener.proto b/api/envoy/config/listener/v3/listener.proto index aac1166f49fd..beb5cd16f68f 100644 --- a/api/envoy/config/listener/v3/listener.proto +++ b/api/envoy/config/listener/v3/listener.proto @@ -15,7 +15,7 @@ import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; +import "xds/core/v3/collection_entry.proto"; import "udpa/annotations/security.proto"; import "udpa/annotations/status.proto"; @@ -33,7 +33,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Listener list collections. Entries are *Listener* resources or references. // [#not-implemented-hide:] message ListenerCollection { - repeated udpa.core.v1.CollectionEntry entries = 1; + repeated xds.core.v3.CollectionEntry entries = 1; } // [#next-free-field: 26] diff --git a/api/envoy/config/listener/v4alpha/BUILD b/api/envoy/config/listener/v4alpha/BUILD index 02af8dfd8061..005a92722c4e 100644 --- a/api/envoy/config/listener/v4alpha/BUILD +++ b/api/envoy/config/listener/v4alpha/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/config/listener/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/config/listener/v4alpha/listener.proto b/api/envoy/config/listener/v4alpha/listener.proto index fbc65d0880f3..44d56f32170e 100644 --- a/api/envoy/config/listener/v4alpha/listener.proto +++ b/api/envoy/config/listener/v4alpha/listener.proto @@ -15,7 +15,7 @@ import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; +import "xds/core/v3/collection_entry.proto"; import "udpa/annotations/security.proto"; import "udpa/annotations/status.proto"; @@ -36,7 +36,7 @@ message ListenerCollection { option (udpa.annotations.versioning).previous_message_type = "envoy.config.listener.v3.ListenerCollection"; - repeated udpa.core.v1.CollectionEntry entries = 1; + repeated xds.core.v3.CollectionEntry entries = 1; } // [#next-free-field: 26] diff --git a/api/envoy/extensions/common/tap/v3/BUILD b/api/envoy/extensions/common/tap/v3/BUILD index 2ad1221bb717..2bc6d64fecb3 100644 --- a/api/envoy/extensions/common/tap/v3/BUILD +++ b/api/envoy/extensions/common/tap/v3/BUILD @@ -9,6 +9,6 @@ api_proto_package( "//envoy/config/common/tap/v2alpha:pkg", "//envoy/config/tap/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/extensions/common/tap/v3/common.proto b/api/envoy/extensions/common/tap/v3/common.proto index c71bff14008b..79a7df0a56dd 100644 --- a/api/envoy/extensions/common/tap/v3/common.proto +++ b/api/envoy/extensions/common/tap/v3/common.proto @@ -4,7 +4,7 @@ package envoy.extensions.common.tap.v3; import "envoy/config/tap/v3/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; diff --git a/api/envoy/extensions/common/tap/v4alpha/BUILD b/api/envoy/extensions/common/tap/v4alpha/BUILD index 37f19ce2acd1..2d7db21d189b 100644 --- a/api/envoy/extensions/common/tap/v4alpha/BUILD +++ b/api/envoy/extensions/common/tap/v4alpha/BUILD @@ -9,6 +9,6 @@ api_proto_package( "//envoy/config/tap/v4alpha:pkg", "//envoy/extensions/common/tap/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/extensions/common/tap/v4alpha/common.proto b/api/envoy/extensions/common/tap/v4alpha/common.proto index b40101232ba2..25924dbd3cba 100644 --- a/api/envoy/extensions/common/tap/v4alpha/common.proto +++ b/api/envoy/extensions/common/tap/v4alpha/common.proto @@ -4,7 +4,7 @@ package envoy.extensions.common.tap.v4alpha; import "envoy/config/tap/v4alpha/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; diff --git a/api/envoy/extensions/filters/network/http_connection_manager/v3/BUILD b/api/envoy/extensions/filters/network/http_connection_manager/v3/BUILD index a436c701caef..cf7cbf2c0a48 100644 --- a/api/envoy/extensions/filters/network/http_connection_manager/v3/BUILD +++ b/api/envoy/extensions/filters/network/http_connection_manager/v3/BUILD @@ -15,6 +15,6 @@ api_proto_package( "//envoy/type/tracing/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index c2254c4c117a..2f30e95f341f 100644 --- a/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -19,7 +19,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/migrate.proto"; @@ -656,7 +656,7 @@ message Rds { // Resource locator for RDS. This is mutually exclusive to *route_config_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rds_resource_locator = 3 + xds.core.v3.ResourceLocator rds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; } diff --git a/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD b/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD index 233b00b4e9d9..b707cacf46a3 100644 --- a/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD +++ b/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD @@ -15,6 +15,6 @@ api_proto_package( "//envoy/type/tracing/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto b/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto index a44d35f86ae2..11e48877e2ed 100644 --- a/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto +++ b/api/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto @@ -19,7 +19,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/security.proto"; @@ -661,7 +661,7 @@ message Rds { // Resource locator for RDS. This is mutually exclusive to *route_config_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rds_resource_locator = 3; + xds.core.v3.ResourceLocator rds_resource_locator = 3; } } diff --git a/api/envoy/extensions/transport_sockets/tls/v3/BUILD b/api/envoy/extensions/transport_sockets/tls/v3/BUILD index 253ce582cc6d..5a9c5b183ceb 100644 --- a/api/envoy/extensions/transport_sockets/tls/v3/BUILD +++ b/api/envoy/extensions/transport_sockets/tls/v3/BUILD @@ -10,6 +10,6 @@ api_proto_package( "//envoy/config/core/v3:pkg", "//envoy/type/matcher/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/extensions/transport_sockets/tls/v3/secret.proto b/api/envoy/extensions/transport_sockets/tls/v3/secret.proto index f25370c3c9f6..86f123be07e6 100644 --- a/api/envoy/extensions/transport_sockets/tls/v3/secret.proto +++ b/api/envoy/extensions/transport_sockets/tls/v3/secret.proto @@ -6,7 +6,7 @@ import "envoy/config/core/v3/base.proto"; import "envoy/config/core/v3/config_source.proto"; import "envoy/extensions/transport_sockets/tls/v3/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/sensitive.proto"; @@ -41,7 +41,7 @@ message SdsSecretConfig { // Resource locator for SDS. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator sds_resource_locator = 3 + xds.core.v3.ResourceLocator sds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; config.core.v3.ConfigSource sds_config = 2; diff --git a/api/envoy/extensions/transport_sockets/tls/v4alpha/BUILD b/api/envoy/extensions/transport_sockets/tls/v4alpha/BUILD index 9e9271bff7fb..568b4d557a76 100644 --- a/api/envoy/extensions/transport_sockets/tls/v4alpha/BUILD +++ b/api/envoy/extensions/transport_sockets/tls/v4alpha/BUILD @@ -10,6 +10,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v3:pkg", "//envoy/type/matcher/v4alpha:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto b/api/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto index 9848eaadef0b..ec04d8c14ad6 100644 --- a/api/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto +++ b/api/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto @@ -6,7 +6,7 @@ import "envoy/config/core/v4alpha/base.proto"; import "envoy/config/core/v4alpha/config_source.proto"; import "envoy/extensions/transport_sockets/tls/v4alpha/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/sensitive.proto"; import "udpa/annotations/status.proto"; @@ -40,7 +40,7 @@ message SdsSecretConfig { // Resource locator for SDS. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator sds_resource_locator = 3; + xds.core.v3.ResourceLocator sds_resource_locator = 3; } config.core.v4alpha.ConfigSource sds_config = 2; diff --git a/api/envoy/service/discovery/v3/BUILD b/api/envoy/service/discovery/v3/BUILD index 0f00b1a8f369..04108ab57293 100644 --- a/api/envoy/service/discovery/v3/BUILD +++ b/api/envoy/service/discovery/v3/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/config/core/v3:pkg", "//envoy/service/discovery/v2:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/service/discovery/v3/discovery.proto b/api/envoy/service/discovery/v3/discovery.proto index 49bb7a931ef5..c35c5595fcfe 100644 --- a/api/envoy/service/discovery/v3/discovery.proto +++ b/api/envoy/service/discovery/v3/discovery.proto @@ -8,8 +8,8 @@ import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/rpc/status.proto"; -import "udpa/core/v1/resource_locator.proto"; -import "udpa/core/v1/resource_name.proto"; +import "xds/core/v3/resource_locator.proto"; +import "xds/core/v3/resource_name.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; @@ -154,8 +154,8 @@ message DeltaDiscoveryRequest { // Type of the resource that is being requested, e.g. // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This does not need to be set if - // resources are only referenced via *udpa_resource_subscribe* and - // *udpa_resources_unsubscribe*. + // resources are only referenced via *xds_resource_subscribe* and + // *xds_resources_unsubscribe*. string type_url = 2; // DeltaDiscoveryRequests allow the client to add or remove individual @@ -182,20 +182,20 @@ message DeltaDiscoveryRequest { repeated string resource_names_subscribe = 3; // As with *resource_names_subscribe* but used when subscribing to resources indicated - // by a *udpa.core.v1.ResourceLocator*. The directives in the resource locator + // by a *xds.core.v3.ResourceLocator*. The directives in the resource locator // are ignored and the context parameters are matched with // *context_param_specifier* specific semantics. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_subscribe = 8; + repeated xds.core.v3.ResourceLocator xds_resources_subscribe = 8; // A list of Resource names to remove from the list of tracked resources. repeated string resource_names_unsubscribe = 4; // As with *resource_names_unsubscribe* but used when unsubscribing to resources indicated by a - // *udpa.core.v1.ResourceLocator*. This must match a previously subscribed - // resource locator provided in *udpa_resources_subscribe*. + // *xds.core.v3.ResourceLocator*. This must match a previously subscribed + // resource locator provided in *xds_resources_subscribe*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_unsubscribe = 9; + repeated xds.core.v3.ResourceLocator xds_resources_unsubscribe = 9; // Informs the server of the versions of the resources the xDS client knows of, to enable the // client to continue the same logical xDS session even in the face of gRPC stream reconnection. @@ -244,9 +244,9 @@ message DeltaDiscoveryResponse { repeated string removed_resources = 6; // As with *removed_resources* but used when a removed resource was named in - // its *Resource*s with a *udpa.core.v1.ResourceName*. + // its *Resource*s with a *xds.core.v3.ResourceName*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceName udpa_removed_resources = 7; + repeated xds.core.v3.ResourceName udpa_removed_resources = 7; // The nonce provides a way for DeltaDiscoveryRequests to uniquely // reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. @@ -269,8 +269,8 @@ message Resource { // The resource's name, to distinguish it from others of the same type of resource. string name = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; - // Used instead of *name* when a resource with a *udpa.core.v1.ResourceName* is delivered. - udpa.core.v1.ResourceName udpa_resource_name = 5 + // Used instead of *name* when a resource with a *xds.core.v3.ResourceName* is delivered. + xds.core.v3.ResourceName xds_resource_name = 5 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; // The aliases are a list of other names that this resource can go by. diff --git a/api/envoy/service/discovery/v4alpha/BUILD b/api/envoy/service/discovery/v4alpha/BUILD index d940232526ae..07135f1b1c8d 100644 --- a/api/envoy/service/discovery/v4alpha/BUILD +++ b/api/envoy/service/discovery/v4alpha/BUILD @@ -10,6 +10,6 @@ api_proto_package( "//envoy/config/core/v4alpha:pkg", "//envoy/service/discovery/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/api/envoy/service/discovery/v4alpha/discovery.proto b/api/envoy/service/discovery/v4alpha/discovery.proto index e6d15a5d8f93..e620b447a1ba 100644 --- a/api/envoy/service/discovery/v4alpha/discovery.proto +++ b/api/envoy/service/discovery/v4alpha/discovery.proto @@ -8,8 +8,8 @@ import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/rpc/status.proto"; -import "udpa/core/v1/resource_locator.proto"; -import "udpa/core/v1/resource_name.proto"; +import "xds/core/v3/resource_locator.proto"; +import "xds/core/v3/resource_name.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; @@ -156,8 +156,8 @@ message DeltaDiscoveryRequest { // Type of the resource that is being requested, e.g. // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This does not need to be set if - // resources are only referenced via *udpa_resource_subscribe* and - // *udpa_resources_unsubscribe*. + // resources are only referenced via *xds_resource_subscribe* and + // *xds_resources_unsubscribe*. string type_url = 2; // DeltaDiscoveryRequests allow the client to add or remove individual @@ -184,20 +184,20 @@ message DeltaDiscoveryRequest { repeated string resource_names_subscribe = 3; // As with *resource_names_subscribe* but used when subscribing to resources indicated - // by a *udpa.core.v1.ResourceLocator*. The directives in the resource locator + // by a *xds.core.v3.ResourceLocator*. The directives in the resource locator // are ignored and the context parameters are matched with // *context_param_specifier* specific semantics. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_subscribe = 8; + repeated xds.core.v3.ResourceLocator xds_resources_subscribe = 8; // A list of Resource names to remove from the list of tracked resources. repeated string resource_names_unsubscribe = 4; // As with *resource_names_unsubscribe* but used when unsubscribing to resources indicated by a - // *udpa.core.v1.ResourceLocator*. This must match a previously subscribed - // resource locator provided in *udpa_resources_subscribe*. + // *xds.core.v3.ResourceLocator*. This must match a previously subscribed + // resource locator provided in *xds_resources_subscribe*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_unsubscribe = 9; + repeated xds.core.v3.ResourceLocator xds_resources_unsubscribe = 9; // Informs the server of the versions of the resources the xDS client knows of, to enable the // client to continue the same logical xDS session even in the face of gRPC stream reconnection. @@ -246,9 +246,9 @@ message DeltaDiscoveryResponse { repeated string removed_resources = 6; // As with *removed_resources* but used when a removed resource was named in - // its *Resource*s with a *udpa.core.v1.ResourceName*. + // its *Resource*s with a *xds.core.v3.ResourceName*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceName udpa_removed_resources = 7; + repeated xds.core.v3.ResourceName udpa_removed_resources = 7; // The nonce provides a way for DeltaDiscoveryRequests to uniquely // reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. @@ -276,8 +276,8 @@ message Resource { // The resource's name, to distinguish it from others of the same type of resource. string name = 3; - // Used instead of *name* when a resource with a *udpa.core.v1.ResourceName* is delivered. - udpa.core.v1.ResourceName udpa_resource_name = 5; + // Used instead of *name* when a resource with a *xds.core.v3.ResourceName* is delivered. + xds.core.v3.ResourceName xds_resource_name = 5; } // The aliases are a list of other names that this resource can go by. diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 4e3de2a2f2a5..4e50799105e1 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -291,10 +291,9 @@ elif [[ "$CI_TARGET" == "bazel.compile_time_options" ]]; then # This doesn't go into CI but is available for developer convenience. echo "bazel with different compiletime options build with tests..." - if [[ "${TEST_TARGETS[*]}" == "//test/..." ]]; then - cd "${ENVOY_FILTER_EXAMPLE_SRCDIR}" - TEST_TARGETS=("@envoy//test/...") - fi + cd "${ENVOY_FILTER_EXAMPLE_SRCDIR}" + TEST_TARGETS=("${TEST_TARGETS[@]/#\/\//@envoy\/\/}") + # Building all the dependencies from scratch to link them against libc++. echo "Building and testing with wasm=wasmtime: ${TEST_TARGETS[*]}" bazel_with_collection test "${BAZEL_BUILD_OPTIONS[@]}" --define wasm=wasmtime "${COMPILE_TIME_OPTIONS[@]}" -c dbg "${TEST_TARGETS[@]}" --test_tag_filters=-nofips --build_tests_only @@ -302,10 +301,6 @@ elif [[ "$CI_TARGET" == "bazel.compile_time_options" ]]; then echo "Building and testing with wasm=wavm: ${TEST_TARGETS[*]}" bazel_with_collection test "${BAZEL_BUILD_OPTIONS[@]}" --define wasm=wavm "${COMPILE_TIME_OPTIONS[@]}" -c dbg "${TEST_TARGETS[@]}" --test_tag_filters=-nofips --build_tests_only - # Legacy codecs "--define legacy_codecs_in_integration_tests=true" should also be tested in - # integration tests with asan. - bazel_with_collection test "${BAZEL_BUILD_OPTIONS[@]}" --define wasm=wavm "${COMPILE_TIME_OPTIONS[@]}" -c dbg @envoy//test/integration/... --config=clang-asan --build_tests_only - # "--define log_debug_assert_in_release=enabled" must be tested with a release build, so run only # these tests under "-c opt" to save time in CI. bazel_with_collection test "${BAZEL_BUILD_OPTIONS[@]}" --define wasm=wavm "${COMPILE_TIME_OPTIONS[@]}" -c opt @envoy//test/common/common:assert_test @envoy//test/server:server_test diff --git a/ci/docker_rebuild_google-vrp.sh b/ci/docker_rebuild_google-vrp.sh index 4f3149e6732f..b05f79a7bfc1 100755 --- a/ci/docker_rebuild_google-vrp.sh +++ b/ci/docker_rebuild_google-vrp.sh @@ -35,8 +35,10 @@ if [[ -n "$1" ]]; then BASE_DOCKER_IMAGE="ubuntu:20.04" # Copy the binary to deal with symlinks in Bazel cache and Docker daemon confusion. declare -r LOCAL_ENVOY="envoy-binary" - cp -f "$1" "${PWD}/${LOCAL_ENVOY}" - sed -i -e "s@# ADD %local envoy bin%@ADD ${LOCAL_ENVOY}@" "${DOCKER_BUILD_FILE}" + declare -r LOCAL_ENVOY_DIR="build_envoy" + mkdir -p "${LOCAL_ENVOY_DIR}" + cp -f "$1" "${LOCAL_ENVOY_DIR}/${LOCAL_ENVOY}" + sed -i -e "s@# ADD %local envoy bin%@ADD ${LOCAL_ENVOY_DIR}/${LOCAL_ENVOY}@" "${DOCKER_BUILD_FILE}" fi cat "${DOCKER_BUILD_FILE}" @@ -44,6 +46,6 @@ cat "${DOCKER_BUILD_FILE}" docker build -t "envoy-google-vrp:local" --build-arg "ENVOY_VRP_BASE_IMAGE=${BASE_DOCKER_IMAGE}" -f "${DOCKER_BUILD_FILE}" . if [[ -n "$1" ]]; then - rm -f "${LOCAL_ENVOY}" + rm -rf "${LOCAL_ENVOY_DIR}" fi rm -r "${BUILD_DIR}" diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index 5cf3712f3c06..5bad3f54a38a 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -17,6 +17,7 @@ Minor Behavior Changes * ext_authz filter: disable `envoy.reloadable_features.ext_authz_measure_timeout_on_check_created` by default. * ext_authz filter: the deprecated field :ref:`use_alpha ` is no longer supported and cannot be set anymore. * grpc_web filter: if a `grpc-accept-encoding` header is present it's passed as-is to the upstream and if it isn't `grpc-accept-encoding:identity` is sent instead. The header was always overwriten with `grpc-accept-encoding:identity,deflate,gzip` before. +* http: upstream protocol will now only be logged if an upstream stream was established. * jwt_authn filter: added support of Jwt time constraint verification with a clock skew (default to 60 seconds) and added a filter config field :ref:`clock_skew_seconds ` to configure it. * memory: enable new tcmalloc with restartable sequences for aarch64 builds. * mongo proxy metrics: swapped network connection remote and local closed counters previously set reversed (`cx_destroy_local_with_active_rq` and `cx_destroy_remote_with_active_rq`). diff --git a/examples/vrp-local/Dockerfile-vrp b/examples/vrp-local/Dockerfile-vrp new file mode 100644 index 000000000000..71f9b502e903 --- /dev/null +++ b/examples/vrp-local/Dockerfile-vrp @@ -0,0 +1 @@ +FROM envoy-google-vrp:local diff --git a/examples/vrp-local/README.md b/examples/vrp-local/README.md new file mode 100644 index 000000000000..55d3dca8a801 --- /dev/null +++ b/examples/vrp-local/README.md @@ -0,0 +1,3 @@ +Simple test to verify local Envoy binary injection into the VRP image. For more +details on VRP, please see +https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/security/google_vrp. diff --git a/examples/vrp-local/docker-compose.yaml b/examples/vrp-local/docker-compose.yaml new file mode 100644 index 000000000000..46eefcafb9aa --- /dev/null +++ b/examples/vrp-local/docker-compose.yaml @@ -0,0 +1,17 @@ +version: "3.7" +services: + + vrp: + build: + context: . + dockerfile: Dockerfile-vrp + environment: + ENVOY_EDGE_EXTRA_ARGS: "" + ENVOY_ORIGIN_EXTRA_ARGS: "" + networks: + - envoymesh + ports: + - "10000:10000" + +networks: + envoymesh: {} diff --git a/examples/vrp-local/verify.sh b/examples/vrp-local/verify.sh new file mode 100755 index 000000000000..bc5a3d54abc8 --- /dev/null +++ b/examples/vrp-local/verify.sh @@ -0,0 +1,25 @@ +#!/bin/bash -e + +export NAME=vrp-local +export DELAY=10 + +# Grab an Envoy binary to use from latest dev. +CONTAINER_ID=$(docker create envoyproxy/envoy-google-vrp-dev:latest) +docker cp "${CONTAINER_ID}":/usr/local/bin/envoy /tmp/envoy +docker rm "${CONTAINER_ID}" + +pushd "$(dirname "${BASH_SOURCE[0]}")"/../.. +# Follow instructions from +# https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/security/google_vrp#rebuilding-the-docker-image, +# but rather than do a full build (slow), use an Envoy we built earlier. +./ci/docker_rebuild_google-vrp.sh /tmp/envoy +popd + +# shellcheck source=examples/verify-common.sh +. "$(dirname "${BASH_SOURCE[0]}")/../verify-common.sh" + +run_log "Test proxy" +responds_with \ + normal \ + https://localhost:10000/content \ + -k diff --git a/generated_api_shadow/bazel/repository_locations.bzl b/generated_api_shadow/bazel/repository_locations.bzl index d72069046b85..f0173e58946e 100644 --- a/generated_api_shadow/bazel/repository_locations.bzl +++ b/generated_api_shadow/bazel/repository_locations.bzl @@ -22,14 +22,15 @@ REPOSITORY_LOCATIONS_SPEC = dict( use_category = ["api"], ), com_github_cncf_udpa = dict( - project_name = "Universal Data Plane API", - project_desc = "Universal Data Plane API Working Group (UDPA-WG)", + project_name = "xDS API", + project_desc = "xDS API Working Group (xDS-WG)", project_url = "https://github.com/cncf/udpa", - version = "0.0.1", - sha256 = "83a7dcc316d741031f34c0409021432b74a39c4811845a177133f02f948fe2d8", + # During the UDPA -> xDS migration, we aren't working with releases. + version = "5459f2c994033b0afed7e4a70ac7e90c90c1ffee", + sha256 = "c1f5c2438cf725b5f66aa4210dbc4bb691020c5ed4f64d2bc6638b06a11482f1", strip_prefix = "udpa-{version}", - urls = ["https://github.com/cncf/udpa/archive/v{version}.tar.gz"], - release_date = "2020-06-29", + urls = ["https://github.com/cncf/udpa/archive/{version}.tar.gz"], + release_date = "2020-11-20", use_category = ["api"], ), com_github_openzipkin_zipkinapi = dict( diff --git a/generated_api_shadow/envoy/config/bootstrap/v3/BUILD b/generated_api_shadow/envoy/config/bootstrap/v3/BUILD index 634d71245fdd..0ea9120c988f 100644 --- a/generated_api_shadow/envoy/config/bootstrap/v3/BUILD +++ b/generated_api_shadow/envoy/config/bootstrap/v3/BUILD @@ -17,6 +17,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto b/generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto index 52b9a88365d0..ee1f754c345b 100644 --- a/generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto +++ b/generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto @@ -20,7 +20,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/migrate.proto"; @@ -79,7 +79,7 @@ message Bootstrap { // Resource locator for listener collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator lds_resources_locator = 5; + xds.core.v3.ResourceLocator lds_resources_locator = 5; // All post-bootstrap :ref:`Cluster ` definitions are // provided by a single :ref:`CDS ` @@ -88,7 +88,7 @@ message Bootstrap { // Resource locator for cluster collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator cds_resources_locator = 6; + xds.core.v3.ResourceLocator cds_resources_locator = 6; // A single :ref:`ADS ` source may be optionally // specified. This must have :ref:`api_type @@ -108,7 +108,7 @@ message Bootstrap { // A list of :ref:`Node ` field names // that will be included in the context parameters of the effective - // *UdpaResourceLocator* that is sent in a discovery request when resource + // *XdsResourceLocator* that is sent in a discovery request when resource // locators are used for LDS/CDS. Any non-string field will have its JSON // encoding set as the context parameter value, with the exception of // metadata, which will be flattened (see example below). The supported field @@ -246,9 +246,9 @@ message Bootstrap { repeated FatalAction fatal_actions = 28; // Configuration sources that will participate in - // *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as + // *xds.core.v3.ResourceLocator* authority resolution. The algorithm is as // follows: - // 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call + // 1. The authority field is taken from the *xds.core.v3.ResourceLocator*, call // this *resource_authority*. // 2. *resource_authority* is compared against the authorities in any peer // *ConfigSource*. The peer *ConfigSource* is the configuration source @@ -264,7 +264,7 @@ message Bootstrap { // [#not-implemented-hide:] repeated core.v3.ConfigSource config_sources = 22; - // Default configuration source for *udpa.core.v1.ResourceLocator* if all + // Default configuration source for *xds.core.v3.ResourceLocator* if all // other resolution fails. // [#not-implemented-hide:] core.v3.ConfigSource default_config_source = 23; @@ -516,7 +516,7 @@ message RuntimeLayer { // Resource locator for RTDS layer. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rtds_resource_locator = 3 + xds.core.v3.ResourceLocator rtds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; // RTDS configuration source. diff --git a/generated_api_shadow/envoy/config/bootstrap/v4alpha/BUILD b/generated_api_shadow/envoy/config/bootstrap/v4alpha/BUILD index f266cfa5b76e..bd2d87191b48 100644 --- a/generated_api_shadow/envoy/config/bootstrap/v4alpha/BUILD +++ b/generated_api_shadow/envoy/config/bootstrap/v4alpha/BUILD @@ -17,6 +17,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v4alpha:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/bootstrap/v4alpha/bootstrap.proto b/generated_api_shadow/envoy/config/bootstrap/v4alpha/bootstrap.proto index 074936c7226e..fbef8411a8aa 100644 --- a/generated_api_shadow/envoy/config/bootstrap/v4alpha/bootstrap.proto +++ b/generated_api_shadow/envoy/config/bootstrap/v4alpha/bootstrap.proto @@ -20,7 +20,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/security.proto"; @@ -78,7 +78,7 @@ message Bootstrap { // Resource locator for listener collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator lds_resources_locator = 5; + xds.core.v3.ResourceLocator lds_resources_locator = 5; // All post-bootstrap :ref:`Cluster ` definitions are // provided by a single :ref:`CDS ` @@ -87,7 +87,7 @@ message Bootstrap { // Resource locator for cluster collection. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator cds_resources_locator = 6; + xds.core.v3.ResourceLocator cds_resources_locator = 6; // A single :ref:`ADS ` source may be optionally // specified. This must have :ref:`api_type @@ -109,7 +109,7 @@ message Bootstrap { // A list of :ref:`Node ` field names // that will be included in the context parameters of the effective - // *UdpaResourceLocator* that is sent in a discovery request when resource + // *XdsResourceLocator* that is sent in a discovery request when resource // locators are used for LDS/CDS. Any non-string field will have its JSON // encoding set as the context parameter value, with the exception of // metadata, which will be flattened (see example below). The supported field @@ -247,9 +247,9 @@ message Bootstrap { repeated FatalAction fatal_actions = 28; // Configuration sources that will participate in - // *udpa.core.v1.ResourceLocator* authority resolution. The algorithm is as + // *xds.core.v3.ResourceLocator* authority resolution. The algorithm is as // follows: - // 1. The authority field is taken from the *udpa.core.v1.ResourceLocator*, call + // 1. The authority field is taken from the *xds.core.v3.ResourceLocator*, call // this *resource_authority*. // 2. *resource_authority* is compared against the authorities in any peer // *ConfigSource*. The peer *ConfigSource* is the configuration source @@ -265,7 +265,7 @@ message Bootstrap { // [#not-implemented-hide:] repeated core.v4alpha.ConfigSource config_sources = 22; - // Default configuration source for *udpa.core.v1.ResourceLocator* if all + // Default configuration source for *xds.core.v3.ResourceLocator* if all // other resolution fails. // [#not-implemented-hide:] core.v4alpha.ConfigSource default_config_source = 23; @@ -524,7 +524,7 @@ message RuntimeLayer { // Resource locator for RTDS layer. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rtds_resource_locator = 3; + xds.core.v3.ResourceLocator rtds_resource_locator = 3; } // RTDS configuration source. diff --git a/generated_api_shadow/envoy/config/cluster/v3/BUILD b/generated_api_shadow/envoy/config/cluster/v3/BUILD index 90170521e691..53f05bbbd9eb 100644 --- a/generated_api_shadow/envoy/config/cluster/v3/BUILD +++ b/generated_api_shadow/envoy/config/cluster/v3/BUILD @@ -14,6 +14,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto index bc39aaa8799e..2973423eaf0d 100644 --- a/generated_api_shadow/envoy/config/cluster/v3/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v3/cluster.proto @@ -20,8 +20,8 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/collection_entry.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/migrate.proto"; @@ -40,7 +40,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Cluster list collections. Entries are *Cluster* resources or references. // [#not-implemented-hide:] message ClusterCollection { - udpa.core.v1.CollectionEntry entries = 1; + xds.core.v3.CollectionEntry entries = 1; } // Configuration for a single upstream cluster. @@ -192,7 +192,7 @@ message Cluster { // Resource locator for EDS. This is mutually exclusive to *service_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator eds_resource_locator = 3 + xds.core.v3.ResourceLocator eds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; } diff --git a/generated_api_shadow/envoy/config/cluster/v4alpha/BUILD b/generated_api_shadow/envoy/config/cluster/v4alpha/BUILD index aab9f272f0d3..2bac8db17256 100644 --- a/generated_api_shadow/envoy/config/cluster/v4alpha/BUILD +++ b/generated_api_shadow/envoy/config/cluster/v4alpha/BUILD @@ -12,6 +12,6 @@ api_proto_package( "//envoy/config/endpoint/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto index d83b54cabeb4..5ee999c2e2dc 100644 --- a/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto +++ b/generated_api_shadow/envoy/config/cluster/v4alpha/cluster.proto @@ -19,8 +19,8 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/collection_entry.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/security.proto"; @@ -41,7 +41,7 @@ message ClusterCollection { option (udpa.annotations.versioning).previous_message_type = "envoy.config.cluster.v3.ClusterCollection"; - udpa.core.v1.CollectionEntry entries = 1; + xds.core.v3.CollectionEntry entries = 1; } // Configuration for a single upstream cluster. @@ -195,7 +195,7 @@ message Cluster { // Resource locator for EDS. This is mutually exclusive to *service_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator eds_resource_locator = 3; + xds.core.v3.ResourceLocator eds_resource_locator = 3; } } diff --git a/generated_api_shadow/envoy/config/core/v3/BUILD b/generated_api_shadow/envoy/config/core/v3/BUILD index 4691a421939a..72e10b6df844 100644 --- a/generated_api_shadow/envoy/config/core/v3/BUILD +++ b/generated_api_shadow/envoy/config/core/v3/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/type/matcher/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/core/v3/config_source.proto b/generated_api_shadow/envoy/config/core/v3/config_source.proto index 9e7b8b777ec7..9ac43cdc4fc0 100644 --- a/generated_api_shadow/envoy/config/core/v3/config_source.proto +++ b/generated_api_shadow/envoy/config/core/v3/config_source.proto @@ -7,7 +7,7 @@ import "envoy/config/core/v3/grpc_service.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/authority.proto"; +import "xds/core/v3/authority.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/status.proto"; @@ -153,11 +153,11 @@ message ConfigSource { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.ConfigSource"; // Authorities that this config source may be used for. An authority specified - // in a *udpa.core.v1.ResourceLocator* is resolved to a *ConfigSource* prior + // in a *xds.core.v3.ResourceLocator* is resolved to a *ConfigSource* prior // to configuration fetch. This field provides the association between // authority name and configuration source. // [#not-implemented-hide:] - repeated udpa.core.v1.Authority authorities = 7; + repeated xds.core.v3.Authority authorities = 7; oneof config_source_specifier { option (validate.required) = true; diff --git a/generated_api_shadow/envoy/config/core/v4alpha/BUILD b/generated_api_shadow/envoy/config/core/v4alpha/BUILD index 77ef526ee759..c9e435fda9a9 100644 --- a/generated_api_shadow/envoy/config/core/v4alpha/BUILD +++ b/generated_api_shadow/envoy/config/core/v4alpha/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/type/matcher/v4alpha:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/core/v4alpha/config_source.proto b/generated_api_shadow/envoy/config/core/v4alpha/config_source.proto index b10e0377be65..f0b6fcc78641 100644 --- a/generated_api_shadow/envoy/config/core/v4alpha/config_source.proto +++ b/generated_api_shadow/envoy/config/core/v4alpha/config_source.proto @@ -7,7 +7,7 @@ import "envoy/config/core/v4alpha/grpc_service.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/authority.proto"; +import "xds/core/v3/authority.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/status.proto"; @@ -155,11 +155,11 @@ message ConfigSource { option (udpa.annotations.versioning).previous_message_type = "envoy.config.core.v3.ConfigSource"; // Authorities that this config source may be used for. An authority specified - // in a *udpa.core.v1.ResourceLocator* is resolved to a *ConfigSource* prior + // in a *xds.core.v3.ResourceLocator* is resolved to a *ConfigSource* prior // to configuration fetch. This field provides the association between // authority name and configuration source. // [#not-implemented-hide:] - repeated udpa.core.v1.Authority authorities = 7; + repeated xds.core.v3.Authority authorities = 7; oneof config_source_specifier { option (validate.required) = true; diff --git a/generated_api_shadow/envoy/config/listener/v3/BUILD b/generated_api_shadow/envoy/config/listener/v3/BUILD index ed1f1731ebb1..605660eec4dc 100644 --- a/generated_api_shadow/envoy/config/listener/v3/BUILD +++ b/generated_api_shadow/envoy/config/listener/v3/BUILD @@ -14,6 +14,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/listener/v3/listener.proto b/generated_api_shadow/envoy/config/listener/v3/listener.proto index 7376e2e2b716..bc84041e2643 100644 --- a/generated_api_shadow/envoy/config/listener/v3/listener.proto +++ b/generated_api_shadow/envoy/config/listener/v3/listener.proto @@ -15,7 +15,7 @@ import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; +import "xds/core/v3/collection_entry.proto"; import "udpa/annotations/security.proto"; import "udpa/annotations/status.proto"; @@ -33,7 +33,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // Listener list collections. Entries are *Listener* resources or references. // [#not-implemented-hide:] message ListenerCollection { - repeated udpa.core.v1.CollectionEntry entries = 1; + repeated xds.core.v3.CollectionEntry entries = 1; } // [#next-free-field: 26] diff --git a/generated_api_shadow/envoy/config/listener/v4alpha/BUILD b/generated_api_shadow/envoy/config/listener/v4alpha/BUILD index 02af8dfd8061..005a92722c4e 100644 --- a/generated_api_shadow/envoy/config/listener/v4alpha/BUILD +++ b/generated_api_shadow/envoy/config/listener/v4alpha/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/config/listener/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/config/listener/v4alpha/listener.proto b/generated_api_shadow/envoy/config/listener/v4alpha/listener.proto index fbc65d0880f3..44d56f32170e 100644 --- a/generated_api_shadow/envoy/config/listener/v4alpha/listener.proto +++ b/generated_api_shadow/envoy/config/listener/v4alpha/listener.proto @@ -15,7 +15,7 @@ import "google/api/annotations.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/collection_entry.proto"; +import "xds/core/v3/collection_entry.proto"; import "udpa/annotations/security.proto"; import "udpa/annotations/status.proto"; @@ -36,7 +36,7 @@ message ListenerCollection { option (udpa.annotations.versioning).previous_message_type = "envoy.config.listener.v3.ListenerCollection"; - repeated udpa.core.v1.CollectionEntry entries = 1; + repeated xds.core.v3.CollectionEntry entries = 1; } // [#next-free-field: 26] diff --git a/generated_api_shadow/envoy/extensions/common/tap/v3/BUILD b/generated_api_shadow/envoy/extensions/common/tap/v3/BUILD index 2ad1221bb717..2bc6d64fecb3 100644 --- a/generated_api_shadow/envoy/extensions/common/tap/v3/BUILD +++ b/generated_api_shadow/envoy/extensions/common/tap/v3/BUILD @@ -9,6 +9,6 @@ api_proto_package( "//envoy/config/common/tap/v2alpha:pkg", "//envoy/config/tap/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/extensions/common/tap/v3/common.proto b/generated_api_shadow/envoy/extensions/common/tap/v3/common.proto index c71bff14008b..79a7df0a56dd 100644 --- a/generated_api_shadow/envoy/extensions/common/tap/v3/common.proto +++ b/generated_api_shadow/envoy/extensions/common/tap/v3/common.proto @@ -4,7 +4,7 @@ package envoy.extensions.common.tap.v3; import "envoy/config/tap/v3/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; diff --git a/generated_api_shadow/envoy/extensions/common/tap/v4alpha/BUILD b/generated_api_shadow/envoy/extensions/common/tap/v4alpha/BUILD index 37f19ce2acd1..2d7db21d189b 100644 --- a/generated_api_shadow/envoy/extensions/common/tap/v4alpha/BUILD +++ b/generated_api_shadow/envoy/extensions/common/tap/v4alpha/BUILD @@ -9,6 +9,6 @@ api_proto_package( "//envoy/config/tap/v4alpha:pkg", "//envoy/extensions/common/tap/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/extensions/common/tap/v4alpha/common.proto b/generated_api_shadow/envoy/extensions/common/tap/v4alpha/common.proto index b40101232ba2..25924dbd3cba 100644 --- a/generated_api_shadow/envoy/extensions/common/tap/v4alpha/common.proto +++ b/generated_api_shadow/envoy/extensions/common/tap/v4alpha/common.proto @@ -4,7 +4,7 @@ package envoy.extensions.common.tap.v4alpha; import "envoy/config/tap/v4alpha/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; diff --git a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/BUILD b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/BUILD index a436c701caef..cf7cbf2c0a48 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/BUILD +++ b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/BUILD @@ -15,6 +15,6 @@ api_proto_package( "//envoy/type/tracing/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 250c91077fa1..c9c4e4faf544 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -19,7 +19,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/migrate.proto"; @@ -661,7 +661,7 @@ message Rds { // Resource locator for RDS. This is mutually exclusive to *route_config_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rds_resource_locator = 3 + xds.core.v3.ResourceLocator rds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; } diff --git a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD index 233b00b4e9d9..b707cacf46a3 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD +++ b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/BUILD @@ -15,6 +15,6 @@ api_proto_package( "//envoy/type/tracing/v3:pkg", "//envoy/type/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto index a44d35f86ae2..11e48877e2ed 100644 --- a/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto +++ b/generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto @@ -19,7 +19,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/wrappers.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "envoy/annotations/deprecation.proto"; import "udpa/annotations/security.proto"; @@ -661,7 +661,7 @@ message Rds { // Resource locator for RDS. This is mutually exclusive to *route_config_name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator rds_resource_locator = 3; + xds.core.v3.ResourceLocator rds_resource_locator = 3; } } diff --git a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/BUILD b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/BUILD index 253ce582cc6d..5a9c5b183ceb 100644 --- a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/BUILD +++ b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/BUILD @@ -10,6 +10,6 @@ api_proto_package( "//envoy/config/core/v3:pkg", "//envoy/type/matcher/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/secret.proto b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/secret.proto index f25370c3c9f6..86f123be07e6 100644 --- a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/secret.proto +++ b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v3/secret.proto @@ -6,7 +6,7 @@ import "envoy/config/core/v3/base.proto"; import "envoy/config/core/v3/config_source.proto"; import "envoy/extensions/transport_sockets/tls/v3/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/sensitive.proto"; @@ -41,7 +41,7 @@ message SdsSecretConfig { // Resource locator for SDS. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator sds_resource_locator = 3 + xds.core.v3.ResourceLocator sds_resource_locator = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; config.core.v3.ConfigSource sds_config = 2; diff --git a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/BUILD b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/BUILD index 9e9271bff7fb..568b4d557a76 100644 --- a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/BUILD +++ b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/BUILD @@ -10,6 +10,6 @@ api_proto_package( "//envoy/extensions/transport_sockets/tls/v3:pkg", "//envoy/type/matcher/v4alpha:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto index 9848eaadef0b..ec04d8c14ad6 100644 --- a/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto +++ b/generated_api_shadow/envoy/extensions/transport_sockets/tls/v4alpha/secret.proto @@ -6,7 +6,7 @@ import "envoy/config/core/v4alpha/base.proto"; import "envoy/config/core/v4alpha/config_source.proto"; import "envoy/extensions/transport_sockets/tls/v4alpha/common.proto"; -import "udpa/core/v1/resource_locator.proto"; +import "xds/core/v3/resource_locator.proto"; import "udpa/annotations/sensitive.proto"; import "udpa/annotations/status.proto"; @@ -40,7 +40,7 @@ message SdsSecretConfig { // Resource locator for SDS. This is mutually exclusive to *name*. // [#not-implemented-hide:] - udpa.core.v1.ResourceLocator sds_resource_locator = 3; + xds.core.v3.ResourceLocator sds_resource_locator = 3; } config.core.v4alpha.ConfigSource sds_config = 2; diff --git a/generated_api_shadow/envoy/service/discovery/v3/BUILD b/generated_api_shadow/envoy/service/discovery/v3/BUILD index 0f00b1a8f369..04108ab57293 100644 --- a/generated_api_shadow/envoy/service/discovery/v3/BUILD +++ b/generated_api_shadow/envoy/service/discovery/v3/BUILD @@ -11,6 +11,6 @@ api_proto_package( "//envoy/config/core/v3:pkg", "//envoy/service/discovery/v2:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/service/discovery/v3/discovery.proto b/generated_api_shadow/envoy/service/discovery/v3/discovery.proto index 49bb7a931ef5..c35c5595fcfe 100644 --- a/generated_api_shadow/envoy/service/discovery/v3/discovery.proto +++ b/generated_api_shadow/envoy/service/discovery/v3/discovery.proto @@ -8,8 +8,8 @@ import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/rpc/status.proto"; -import "udpa/core/v1/resource_locator.proto"; -import "udpa/core/v1/resource_name.proto"; +import "xds/core/v3/resource_locator.proto"; +import "xds/core/v3/resource_name.proto"; import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; @@ -154,8 +154,8 @@ message DeltaDiscoveryRequest { // Type of the resource that is being requested, e.g. // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This does not need to be set if - // resources are only referenced via *udpa_resource_subscribe* and - // *udpa_resources_unsubscribe*. + // resources are only referenced via *xds_resource_subscribe* and + // *xds_resources_unsubscribe*. string type_url = 2; // DeltaDiscoveryRequests allow the client to add or remove individual @@ -182,20 +182,20 @@ message DeltaDiscoveryRequest { repeated string resource_names_subscribe = 3; // As with *resource_names_subscribe* but used when subscribing to resources indicated - // by a *udpa.core.v1.ResourceLocator*. The directives in the resource locator + // by a *xds.core.v3.ResourceLocator*. The directives in the resource locator // are ignored and the context parameters are matched with // *context_param_specifier* specific semantics. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_subscribe = 8; + repeated xds.core.v3.ResourceLocator xds_resources_subscribe = 8; // A list of Resource names to remove from the list of tracked resources. repeated string resource_names_unsubscribe = 4; // As with *resource_names_unsubscribe* but used when unsubscribing to resources indicated by a - // *udpa.core.v1.ResourceLocator*. This must match a previously subscribed - // resource locator provided in *udpa_resources_subscribe*. + // *xds.core.v3.ResourceLocator*. This must match a previously subscribed + // resource locator provided in *xds_resources_subscribe*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_unsubscribe = 9; + repeated xds.core.v3.ResourceLocator xds_resources_unsubscribe = 9; // Informs the server of the versions of the resources the xDS client knows of, to enable the // client to continue the same logical xDS session even in the face of gRPC stream reconnection. @@ -244,9 +244,9 @@ message DeltaDiscoveryResponse { repeated string removed_resources = 6; // As with *removed_resources* but used when a removed resource was named in - // its *Resource*s with a *udpa.core.v1.ResourceName*. + // its *Resource*s with a *xds.core.v3.ResourceName*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceName udpa_removed_resources = 7; + repeated xds.core.v3.ResourceName udpa_removed_resources = 7; // The nonce provides a way for DeltaDiscoveryRequests to uniquely // reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. @@ -269,8 +269,8 @@ message Resource { // The resource's name, to distinguish it from others of the same type of resource. string name = 3 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; - // Used instead of *name* when a resource with a *udpa.core.v1.ResourceName* is delivered. - udpa.core.v1.ResourceName udpa_resource_name = 5 + // Used instead of *name* when a resource with a *xds.core.v3.ResourceName* is delivered. + xds.core.v3.ResourceName xds_resource_name = 5 [(udpa.annotations.field_migrate).oneof_promotion = "name_specifier"]; // The aliases are a list of other names that this resource can go by. diff --git a/generated_api_shadow/envoy/service/discovery/v4alpha/BUILD b/generated_api_shadow/envoy/service/discovery/v4alpha/BUILD index d940232526ae..07135f1b1c8d 100644 --- a/generated_api_shadow/envoy/service/discovery/v4alpha/BUILD +++ b/generated_api_shadow/envoy/service/discovery/v4alpha/BUILD @@ -10,6 +10,6 @@ api_proto_package( "//envoy/config/core/v4alpha:pkg", "//envoy/service/discovery/v3:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", - "@com_github_cncf_udpa//udpa/core/v1:pkg", + "@com_github_cncf_udpa//xds/core/v3:pkg", ], ) diff --git a/generated_api_shadow/envoy/service/discovery/v4alpha/discovery.proto b/generated_api_shadow/envoy/service/discovery/v4alpha/discovery.proto index e6d15a5d8f93..e620b447a1ba 100644 --- a/generated_api_shadow/envoy/service/discovery/v4alpha/discovery.proto +++ b/generated_api_shadow/envoy/service/discovery/v4alpha/discovery.proto @@ -8,8 +8,8 @@ import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; import "google/rpc/status.proto"; -import "udpa/core/v1/resource_locator.proto"; -import "udpa/core/v1/resource_name.proto"; +import "xds/core/v3/resource_locator.proto"; +import "xds/core/v3/resource_name.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; @@ -156,8 +156,8 @@ message DeltaDiscoveryRequest { // Type of the resource that is being requested, e.g. // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This does not need to be set if - // resources are only referenced via *udpa_resource_subscribe* and - // *udpa_resources_unsubscribe*. + // resources are only referenced via *xds_resource_subscribe* and + // *xds_resources_unsubscribe*. string type_url = 2; // DeltaDiscoveryRequests allow the client to add or remove individual @@ -184,20 +184,20 @@ message DeltaDiscoveryRequest { repeated string resource_names_subscribe = 3; // As with *resource_names_subscribe* but used when subscribing to resources indicated - // by a *udpa.core.v1.ResourceLocator*. The directives in the resource locator + // by a *xds.core.v3.ResourceLocator*. The directives in the resource locator // are ignored and the context parameters are matched with // *context_param_specifier* specific semantics. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_subscribe = 8; + repeated xds.core.v3.ResourceLocator xds_resources_subscribe = 8; // A list of Resource names to remove from the list of tracked resources. repeated string resource_names_unsubscribe = 4; // As with *resource_names_unsubscribe* but used when unsubscribing to resources indicated by a - // *udpa.core.v1.ResourceLocator*. This must match a previously subscribed - // resource locator provided in *udpa_resources_subscribe*. + // *xds.core.v3.ResourceLocator*. This must match a previously subscribed + // resource locator provided in *xds_resources_subscribe*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceLocator udpa_resources_unsubscribe = 9; + repeated xds.core.v3.ResourceLocator xds_resources_unsubscribe = 9; // Informs the server of the versions of the resources the xDS client knows of, to enable the // client to continue the same logical xDS session even in the face of gRPC stream reconnection. @@ -246,9 +246,9 @@ message DeltaDiscoveryResponse { repeated string removed_resources = 6; // As with *removed_resources* but used when a removed resource was named in - // its *Resource*s with a *udpa.core.v1.ResourceName*. + // its *Resource*s with a *xds.core.v3.ResourceName*. // [#not-implemented-hide:] - repeated udpa.core.v1.ResourceName udpa_removed_resources = 7; + repeated xds.core.v3.ResourceName udpa_removed_resources = 7; // The nonce provides a way for DeltaDiscoveryRequests to uniquely // reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. @@ -276,8 +276,8 @@ message Resource { // The resource's name, to distinguish it from others of the same type of resource. string name = 3; - // Used instead of *name* when a resource with a *udpa.core.v1.ResourceName* is delivered. - udpa.core.v1.ResourceName udpa_resource_name = 5; + // Used instead of *name* when a resource with a *xds.core.v3.ResourceName* is delivered. + xds.core.v3.ResourceName xds_resource_name = 5; } // The aliases are a list of other names that this resource can go by. diff --git a/include/envoy/config/subscription_factory.h b/include/envoy/config/subscription_factory.h index ff6dd4d9642f..16e2e767cecb 100644 --- a/include/envoy/config/subscription_factory.h +++ b/include/envoy/config/subscription_factory.h @@ -44,7 +44,7 @@ class SubscriptionFactory { * @return SubscriptionPtr subscription object corresponding for collection_locator. */ virtual SubscriptionPtr - collectionSubscriptionFromUrl(const udpa::core::v1::ResourceLocator& collection_locator, + collectionSubscriptionFromUrl(const xds::core::v3::ResourceLocator& collection_locator, const envoy::config::core::v3::ConfigSource& config, absl::string_view type_url, Stats::Scope& scope, SubscriptionCallbacks& callbacks, diff --git a/include/envoy/http/conn_pool.h b/include/envoy/http/conn_pool.h index 753956243524..081c293c8462 100644 --- a/include/envoy/http/conn_pool.h +++ b/include/envoy/http/conn_pool.h @@ -39,10 +39,12 @@ class Callbacks { * @param encoder supplies the request encoder to use. * @param host supplies the description of the host that will carry the request. For logical * connection pools the description may be different each time this is called. - * @param info supplies the stream info object associated with the upstream connection. + * @param info supplies the stream info object associated with the upstream L4 connection. + * @param protocol supplies the protocol associated with the stream, or absl::nullopt for raw TCP. */ virtual void onPoolReady(RequestEncoder& encoder, Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo& info) PURE; + const StreamInfo::StreamInfo& info, + absl::optional protocol) PURE; }; /** @@ -52,11 +54,6 @@ class Instance : public Envoy::ConnectionPool::Instance, public Event::DeferredD public: ~Instance() override = default; - /** - * @return Http::Protocol Reports the protocol in use by this connection pool. - */ - virtual Http::Protocol protocol() const PURE; - /** * Determines whether the connection pool is actively processing any requests. * @return true if the connection pool has any pending requests or any active requests. diff --git a/include/envoy/router/router.h b/include/envoy/router/router.h index f9454eee452d..ddc1820240f7 100644 --- a/include/envoy/router/router.h +++ b/include/envoy/router/router.h @@ -1181,10 +1181,6 @@ class GenericConnPool { * Called to cancel any pending newStream request, */ virtual bool cancelAnyPendingStream() PURE; - /** - * @return optionally returns the protocol for the connection pool. - */ - virtual absl::optional protocol() const PURE; /** * @return optionally returns the host for the connection pool. */ @@ -1237,11 +1233,13 @@ class GenericConnectionPoolCallbacks { * connection pools the description may be different each time this is called. * @param upstream_local_address supplies the local address of the upstream connection. * @param info supplies the stream info object associated with the upstream connection. + * @param protocol supplies the protocol associated with the upstream connection. */ virtual void onPoolReady(std::unique_ptr&& upstream, Upstream::HostDescriptionConstSharedPtr host, const Network::Address::InstanceConstSharedPtr& upstream_local_address, - const StreamInfo::StreamInfo& info) PURE; + const StreamInfo::StreamInfo& info, + absl::optional protocol) PURE; // @return the UpstreamToDownstream interface for this stream. // diff --git a/include/envoy/server/listener_manager.h b/include/envoy/server/listener_manager.h index 86e5548f730c..d76d73cf315e 100644 --- a/include/envoy/server/listener_manager.h +++ b/include/envoy/server/listener_manager.h @@ -58,10 +58,10 @@ class ListenerComponentFactory { /** * @return an LDS API provider. * @param lds_config supplies the management server configuration. - * @param lds_resources_locator udpa::core::v1::ResourceLocator for listener collection. + * @param lds_resources_locator xds::core::v3::ResourceLocator for listener collection. */ virtual LdsApiPtr createLdsApi(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator) PURE; + const xds::core::v3::ResourceLocator* lds_resources_locator) PURE; /** * Creates a socket. @@ -169,10 +169,10 @@ class ListenerManager { * during server initialization because the listener manager is created prior to several core * pieces of the server existing. * @param lds_config supplies the management server configuration. - * @param lds_resources_locator udpa::core::v1::ResourceLocator for listener collection. + * @param lds_resources_locator xds::core::v3::ResourceLocator for listener collection. */ virtual void createLdsApi(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator) PURE; + const xds::core::v3::ResourceLocator* lds_resources_locator) PURE; /** * @param state the type of listener to be returned (defaults to ACTIVE), states can be OR'd diff --git a/source/common/config/BUILD b/source/common/config/BUILD index baf4f851e998..a92b3e017920 100644 --- a/source/common/config/BUILD +++ b/source/common/config/BUILD @@ -67,7 +67,7 @@ envoy_cc_library( deps = [ "//include/envoy/config:subscription_interface", "//source/common/protobuf:utility_lib", - "@com_github_cncf_udpa//udpa/core/v1:pkg_cc_proto", + "@com_github_cncf_udpa//xds/core/v3:pkg_cc_proto", "@envoy_api//envoy/service/discovery/v3:pkg_cc_proto", ], ) @@ -320,8 +320,8 @@ envoy_cc_library( ":http_subscription_lib", ":new_grpc_mux_lib", ":type_to_endpoint_lib", - ":udpa_resource_lib", ":utility_lib", + ":xds_resource_lib", "//include/envoy/config:subscription_factory_interface", "//include/envoy/config:subscription_interface", "//include/envoy/upstream:cluster_manager_interface", @@ -345,24 +345,24 @@ envoy_cc_library( ) envoy_cc_library( - name = "udpa_context_params_lib", - srcs = ["udpa_context_params.cc"], - hdrs = ["udpa_context_params.h"], + name = "xds_context_params_lib", + srcs = ["xds_context_params.cc"], + hdrs = ["xds_context_params.h"], deps = [ "//source/common/common:macros", "//source/common/protobuf:utility_lib", - "@com_github_cncf_udpa//udpa/core/v1:pkg_cc_proto", + "@com_github_cncf_udpa//xds/core/v3:pkg_cc_proto", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", ], ) envoy_cc_library( - name = "udpa_resource_lib", - srcs = ["udpa_resource.cc"], - hdrs = ["udpa_resource.h"], + name = "xds_resource_lib", + srcs = ["xds_resource.cc"], + hdrs = ["xds_resource.h"], deps = [ "//source/common/http:utility_lib", - "@com_github_cncf_udpa//udpa/core/v1:pkg_cc_proto", + "@com_github_cncf_udpa//xds/core/v3:pkg_cc_proto", ], ) diff --git a/source/common/config/decoded_resource_impl.h b/source/common/config/decoded_resource_impl.h index 983cca19a606..04299f7745ba 100644 --- a/source/common/config/decoded_resource_impl.h +++ b/source/common/config/decoded_resource_impl.h @@ -5,7 +5,7 @@ #include "common/protobuf/utility.h" -#include "udpa/core/v1/collection_entry.pb.h" +#include "xds/core/v3/collection_entry.pb.h" namespace Envoy { namespace Config { @@ -52,7 +52,7 @@ class DecodedResourceImpl : public DecodedResource { DurationUtil::durationToMilliseconds(resource.ttl()))) : absl::nullopt) {} DecodedResourceImpl(OpaqueResourceDecoder& resource_decoder, - const udpa::core::v1::CollectionEntry::InlineEntry& inline_entry) + const xds::core::v3::CollectionEntry::InlineEntry& inline_entry) : DecodedResourceImpl(resource_decoder, inline_entry.name(), Protobuf::RepeatedPtrField(), inline_entry.resource(), true, inline_entry.version(), absl::nullopt) {} diff --git a/source/common/config/filesystem_subscription_impl.cc b/source/common/config/filesystem_subscription_impl.cc index 13d3829d1cde..35feaa31e5f0 100644 --- a/source/common/config/filesystem_subscription_impl.cc +++ b/source/common/config/filesystem_subscription_impl.cc @@ -113,7 +113,7 @@ FilesystemCollectionSubscriptionImpl::refreshInternal(ProtobufTypes::MessagePtr* if (collection_entries_field_descriptor == nullptr || collection_entries_field_descriptor->type() != Protobuf::FieldDescriptor::TYPE_MESSAGE || collection_entries_field_descriptor->message_type()->full_name() != - "udpa.core.v1.CollectionEntry" || + "xds.core.v3.CollectionEntry" || !collection_entries_field_descriptor->is_repeated()) { throw EnvoyException(fmt::format("Invalid structure for collection type {} in {}", collection_type, resource_message.DebugString())); @@ -123,7 +123,7 @@ FilesystemCollectionSubscriptionImpl::refreshInternal(ProtobufTypes::MessagePtr* reflection->FieldSize(*collection_message, collection_entries_field_descriptor); DecodedResourcesWrapper decoded_resources; for (uint32_t i = 0; i < num_entries; ++i) { - udpa::core::v1::CollectionEntry collection_entry; + xds::core::v3::CollectionEntry collection_entry; collection_entry.MergeFrom(reflection->GetRepeatedMessage( *collection_message, collection_entries_field_descriptor, i)); // TODO(htuch): implement indirect collection entries. diff --git a/source/common/config/subscription_factory_impl.cc b/source/common/config/subscription_factory_impl.cc index 9283654cf419..c59c73f58150 100644 --- a/source/common/config/subscription_factory_impl.cc +++ b/source/common/config/subscription_factory_impl.cc @@ -8,8 +8,8 @@ #include "common/config/http_subscription_impl.h" #include "common/config/new_grpc_mux_impl.h" #include "common/config/type_to_endpoint.h" -#include "common/config/udpa_resource.h" #include "common/config/utility.h" +#include "common/config/xds_resource.h" #include "common/http/utility.h" #include "common/protobuf/protobuf.h" @@ -109,7 +109,7 @@ SubscriptionPtr SubscriptionFactoryImpl::subscriptionFromConfigSource( } SubscriptionPtr SubscriptionFactoryImpl::collectionSubscriptionFromUrl( - const udpa::core::v1::ResourceLocator& collection_locator, + const xds::core::v3::ResourceLocator& collection_locator, const envoy::config::core::v3::ConfigSource& /*config*/, absl::string_view /*type_url*/, Stats::Scope& scope, SubscriptionCallbacks& callbacks, OpaqueResourceDecoder& resource_decoder) { @@ -117,16 +117,15 @@ SubscriptionPtr SubscriptionFactoryImpl::collectionSubscriptionFromUrl( SubscriptionStats stats = Utility::generateStats(scope); switch (collection_locator.scheme()) { - case udpa::core::v1::ResourceLocator::FILE: { - const std::string path = - Http::Utility::localPathFromFilePath(absl::StrJoin(collection_locator.id(), "/")); + case xds::core::v3::ResourceLocator::FILE: { + const std::string path = Http::Utility::localPathFromFilePath(collection_locator.id()); Utility::checkFilesystemSubscriptionBackingPath(path, api_); return std::make_unique( dispatcher_, path, callbacks, resource_decoder, stats, validation_visitor_, api_); } default: throw EnvoyException(fmt::format("Unsupported collection resource locator: {}", - UdpaResourceIdentifier::encodeUrl(collection_locator))); + XdsResourceIdentifier::encodeUrl(collection_locator))); } NOT_REACHED_GCOVR_EXCL_LINE; } diff --git a/source/common/config/subscription_factory_impl.h b/source/common/config/subscription_factory_impl.h index 6e65a7211f13..cc076be46d76 100644 --- a/source/common/config/subscription_factory_impl.h +++ b/source/common/config/subscription_factory_impl.h @@ -26,7 +26,7 @@ class SubscriptionFactoryImpl : public SubscriptionFactory, Logger::Loggable& params, } // namespace -udpa::core::v1::ContextParams UdpaContextParams::encode( +xds::core::v3::ContextParams XdsContextParams::encode( const envoy::config::core::v3::Node& node, const std::vector& node_context_params, - const udpa::core::v1::ContextParams& resource_context_params, + const xds::core::v3::ContextParams& resource_context_params, const std::vector& client_features, const absl::flat_hash_map& extra_resource_params) { - udpa::core::v1::ContextParams context_params; + xds::core::v3::ContextParams context_params; auto& mutable_params = *context_params.mutable_params(); // 1. Establish base layer of per-node context parameters. for (const std::string& ncp : node_context_params) { // First attempt field accessors known ahead of time, if that fails we consider the cases of // metadata, either directly in the Node message, or nested in the user_agent_build_version. if (nodeParamCbs().count(ncp) > 0) { - mutable_params["udpa.node." + ncp] = nodeParamCbs().at(ncp)(node); + mutable_params["xds.node." + ncp] = nodeParamCbs().at(ncp)(node); } else if (ncp == "metadata") { - mergeMetadataJson(mutable_params, node.metadata(), "udpa.node.metadata."); + mergeMetadataJson(mutable_params, node.metadata(), "xds.node.metadata."); } else if (ncp == "user_agent_build_version.metadata") { mergeMetadataJson(mutable_params, node.user_agent_build_version().metadata(), - "udpa.node.user_agent_build_version.metadata."); + "xds.node.user_agent_build_version.metadata."); } } @@ -76,12 +76,12 @@ udpa::core::v1::ContextParams UdpaContextParams::encode( // 3. Overlay with per-resource type context parameters. for (const std::string& cf : client_features) { - mutable_params["udpa.client_feature." + cf] = "true"; + mutable_params["xds.client_feature." + cf] = "true"; } // 4. Overlay with per-resource well-known attributes. for (const auto& it : extra_resource_params) { - mutable_params["udpa.resource." + it.first] = it.second; + mutable_params["xds.resource." + it.first] = it.second; } return context_params; diff --git a/source/common/config/udpa_context_params.h b/source/common/config/xds_context_params.h similarity index 79% rename from source/common/config/udpa_context_params.h rename to source/common/config/xds_context_params.h index 23a1853365ce..72991cf2e3db 100644 --- a/source/common/config/udpa_context_params.h +++ b/source/common/config/xds_context_params.h @@ -3,13 +3,13 @@ #include "envoy/config/core/v3/base.pb.h" #include "absl/container/flat_hash_map.h" -#include "udpa/core/v1/context_params.pb.h" +#include "xds/core/v3/context_params.pb.h" namespace Envoy { namespace Config { // Utilities for working with context parameters. -class UdpaContextParams { +class XdsContextParams { public: /** * Encode context parameters by following the xDS transport precedence algorithm and applying @@ -19,12 +19,12 @@ class UdpaContextParams { * @param resource_context_params context parameters from resource locator. * @param client_features client feature capabilities. * @param extra_resource_param per-resource type well known attributes. - * @return udpa::core::v1::ContextParams encoded context parameters. + * @return xds::core::v3::ContextParams encoded context parameters. */ - static udpa::core::v1::ContextParams + static xds::core::v3::ContextParams encode(const envoy::config::core::v3::Node& node, const std::vector& node_context_params, - const udpa::core::v1::ContextParams& resource_context_params, + const xds::core::v3::ContextParams& resource_context_params, const std::vector& client_features, const absl::flat_hash_map& extra_resource_params); }; diff --git a/source/common/config/udpa_resource.cc b/source/common/config/xds_resource.cc similarity index 68% rename from source/common/config/udpa_resource.cc rename to source/common/config/xds_resource.cc index d990ea875105..5216f96c72f4 100644 --- a/source/common/config/udpa_resource.cc +++ b/source/common/config/xds_resource.cc @@ -1,4 +1,4 @@ -#include "common/config/udpa_resource.h" +#include "common/config/xds_resource.h" #include @@ -25,16 +25,12 @@ std::string encodeAuthority(const std::string& authority) { return PercentEncoding::encode(authority, "%/?#"); } -std::string encodeIdPath(const Protobuf::RepeatedPtrField& id) { - std::vector path_components; - for (const auto& id_component : id) { - path_components.emplace_back(PercentEncoding::encode(id_component, "%:/?#[]")); - } - const std::string path = absl::StrJoin(path_components, "/"); +std::string encodeIdPath(const std::string& id) { + const std::string path = PercentEncoding::encode(id, "%:?#[]"); return path.empty() ? "" : absl::StrCat("/", path); } -std::string encodeContextParams(const udpa::core::v1::ContextParams& context_params, +std::string encodeContextParams(const xds::core::v3::ContextParams& context_params, bool sort_context_params) { std::vector query_param_components; for (const auto& context_param : context_params.params()) { @@ -49,17 +45,17 @@ std::string encodeContextParams(const udpa::core::v1::ContextParams& context_par } std::string encodeDirectives( - const Protobuf::RepeatedPtrField& directives) { + const Protobuf::RepeatedPtrField& directives) { std::vector fragment_components; const std::string DirectiveEscapeChars = "%#[],"; for (const auto& directive : directives) { switch (directive.directive_case()) { - case udpa::core::v1::ResourceLocator::Directive::DirectiveCase::kAlt: + case xds::core::v3::ResourceLocator::Directive::DirectiveCase::kAlt: fragment_components.emplace_back(absl::StrCat( - "alt=", PercentEncoding::encode(UdpaResourceIdentifier::encodeUrl(directive.alt()), + "alt=", PercentEncoding::encode(XdsResourceIdentifier::encodeUrl(directive.alt()), DirectiveEscapeChars))); break; - case udpa::core::v1::ResourceLocator::Directive::DirectiveCase::kEntry: + case xds::core::v3::ResourceLocator::Directive::DirectiveCase::kEntry: fragment_components.emplace_back( absl::StrCat("entry=", PercentEncoding::encode(directive.entry(), DirectiveEscapeChars))); break; @@ -72,34 +68,33 @@ std::string encodeDirectives( } // namespace -std::string UdpaResourceIdentifier::encodeUrn(const udpa::core::v1::ResourceName& resource_name, - const EncodeOptions& options) { +std::string XdsResourceIdentifier::encodeUrn(const xds::core::v3::ResourceName& resource_name, + const EncodeOptions& options) { const std::string authority = encodeAuthority(resource_name.authority()); const std::string id_path = encodeIdPath(resource_name.id()); const std::string query_params = encodeContextParams(resource_name.context(), options.sort_context_params_); - return absl::StrCat("udpa://", authority, "/", resource_name.resource_type(), id_path, + return absl::StrCat("xdstp://", authority, "/", resource_name.resource_type(), id_path, query_params); } -std::string -UdpaResourceIdentifier::encodeUrl(const udpa::core::v1::ResourceLocator& resource_locator, - const EncodeOptions& options) { +std::string XdsResourceIdentifier::encodeUrl(const xds::core::v3::ResourceLocator& resource_locator, + const EncodeOptions& options) { const std::string id_path = encodeIdPath(resource_locator.id()); const std::string fragment = encodeDirectives(resource_locator.directives()); - std::string scheme = "udpa:"; + std::string scheme = "xdstp:"; switch (resource_locator.scheme()) { - case udpa::core::v1::ResourceLocator::HTTP: + case xds::core::v3::ResourceLocator::HTTP: scheme = "http:"; FALLTHRU; - case udpa::core::v1::ResourceLocator::UDPA: { + case xds::core::v3::ResourceLocator::XDSTP: { const std::string authority = encodeAuthority(resource_locator.authority()); const std::string query_params = encodeContextParams(resource_locator.exact_context(), options.sort_context_params_); return absl::StrCat(scheme, "//", authority, "/", resource_locator.resource_type(), id_path, query_params, fragment); } - case udpa::core::v1::ResourceLocator::FILE: { + case xds::core::v3::ResourceLocator::FILE: { return absl::StrCat("file://", id_path, fragment); } default: @@ -109,8 +104,7 @@ UdpaResourceIdentifier::encodeUrl(const udpa::core::v1::ResourceLocator& resourc namespace { -void decodePath(absl::string_view path, std::string* resource_type, - Protobuf::RepeatedPtrField& id) { +void decodePath(absl::string_view path, std::string* resource_type, std::string& id) { // This is guaranteed by Http::Utility::extractHostPathFromUrn. ASSERT(absl::StartsWith(path, "/")); const std::vector path_components = absl::StrSplit(path.substr(1), '/'); @@ -118,18 +112,16 @@ void decodePath(absl::string_view path, std::string* resource_type, if (resource_type != nullptr) { *resource_type = std::string(path_components[0]); if (resource_type->empty()) { - throw UdpaResourceIdentifier::DecodeException( + throw XdsResourceIdentifier::DecodeException( fmt::format("Resource type missing from {}", path)); } id_it = std::next(id_it); } - for (; id_it != path_components.cend(); id_it++) { - *id.Add() = PercentEncoding::decode(*id_it); - } + id = PercentEncoding::decode(absl::StrJoin(id_it, path_components.cend(), "/")); } void decodeQueryParams(absl::string_view query_params, - udpa::core::v1::ContextParams& context_params) { + xds::core::v3::ContextParams& context_params) { Http::Utility::QueryParams query_params_components = Http::Utility::parseQueryString(query_params); for (const auto& it : query_params_components) { @@ -140,16 +132,16 @@ void decodeQueryParams(absl::string_view query_params, void decodeFragment( absl::string_view fragment, - Protobuf::RepeatedPtrField& directives) { + Protobuf::RepeatedPtrField& directives) { const std::vector fragment_components = absl::StrSplit(fragment, ','); for (const absl::string_view& fragment_component : fragment_components) { if (absl::StartsWith(fragment_component, "alt=")) { directives.Add()->mutable_alt()->MergeFrom( - UdpaResourceIdentifier::decodeUrl(PercentEncoding::decode(fragment_component.substr(4)))); + XdsResourceIdentifier::decodeUrl(PercentEncoding::decode(fragment_component.substr(4)))); } else if (absl::StartsWith(fragment_component, "entry=")) { directives.Add()->set_entry(PercentEncoding::decode(fragment_component.substr(6))); } else { - throw UdpaResourceIdentifier::DecodeException( + throw XdsResourceIdentifier::DecodeException( fmt::format("Unknown fragment component {}", fragment_component)); ; } @@ -158,14 +150,14 @@ void decodeFragment( } // namespace -udpa::core::v1::ResourceName UdpaResourceIdentifier::decodeUrn(absl::string_view resource_urn) { - if (!absl::StartsWith(resource_urn, "udpa:")) { - throw UdpaResourceIdentifier::DecodeException( - fmt::format("{} does not have an udpa: scheme", resource_urn)); +xds::core::v3::ResourceName XdsResourceIdentifier::decodeUrn(absl::string_view resource_urn) { + if (!absl::StartsWith(resource_urn, "xdstp:")) { + throw XdsResourceIdentifier::DecodeException( + fmt::format("{} does not have an xdstp: scheme", resource_urn)); } absl::string_view host, path; Http::Utility::extractHostPathFromUri(resource_urn, host, path); - udpa::core::v1::ResourceName decoded_resource_name; + xds::core::v3::ResourceName decoded_resource_name; decoded_resource_name.set_authority(PercentEncoding::decode(host)); const size_t query_params_start = path.find('?'); if (query_params_start != absl::string_view::npos) { @@ -177,27 +169,27 @@ udpa::core::v1::ResourceName UdpaResourceIdentifier::decodeUrn(absl::string_view return decoded_resource_name; } -udpa::core::v1::ResourceLocator UdpaResourceIdentifier::decodeUrl(absl::string_view resource_url) { +xds::core::v3::ResourceLocator XdsResourceIdentifier::decodeUrl(absl::string_view resource_url) { absl::string_view host, path; Http::Utility::extractHostPathFromUri(resource_url, host, path); - udpa::core::v1::ResourceLocator decoded_resource_locator; + xds::core::v3::ResourceLocator decoded_resource_locator; const size_t fragment_start = path.find('#'); if (fragment_start != absl::string_view::npos) { decodeFragment(path.substr(fragment_start + 1), *decoded_resource_locator.mutable_directives()); path = path.substr(0, fragment_start); } - if (absl::StartsWith(resource_url, "udpa:")) { - decoded_resource_locator.set_scheme(udpa::core::v1::ResourceLocator::UDPA); + if (absl::StartsWith(resource_url, "xdstp:")) { + decoded_resource_locator.set_scheme(xds::core::v3::ResourceLocator::XDSTP); } else if (absl::StartsWith(resource_url, "http:")) { - decoded_resource_locator.set_scheme(udpa::core::v1::ResourceLocator::HTTP); + decoded_resource_locator.set_scheme(xds::core::v3::ResourceLocator::HTTP); } else if (absl::StartsWith(resource_url, "file:")) { - decoded_resource_locator.set_scheme(udpa::core::v1::ResourceLocator::FILE); + decoded_resource_locator.set_scheme(xds::core::v3::ResourceLocator::FILE); // File URLs only have a path and fragment. decodePath(path, nullptr, *decoded_resource_locator.mutable_id()); return decoded_resource_locator; } else { - throw UdpaResourceIdentifier::DecodeException( - fmt::format("{} does not have a udpa:, http: or file: scheme", resource_url)); + throw XdsResourceIdentifier::DecodeException( + fmt::format("{} does not have a xdstp:, http: or file: scheme", resource_url)); } decoded_resource_locator.set_authority(PercentEncoding::decode(host)); const size_t query_params_start = path.find('?'); diff --git a/source/common/config/xds_resource.h b/source/common/config/xds_resource.h new file mode 100644 index 000000000000..b62d65db5196 --- /dev/null +++ b/source/common/config/xds_resource.h @@ -0,0 +1,73 @@ +#pragma once + +#include "envoy/common/exception.h" + +#include "absl/strings/string_view.h" +#include "xds/core/v3/resource_locator.pb.h" +#include "xds/core/v3/resource_name.pb.h" + +namespace Envoy { +namespace Config { + +// Utilities for URI encoding/decoding of xds::core::v3::Resource{Name,Locator}. +class XdsResourceIdentifier { +public: + // Options for encoded URIs. + struct EncodeOptions { + // Should the context params be sorted by key? This provides deterministic encoding. + bool sort_context_params_{}; + }; + + /** + * Encode a xds::core::v3::ResourceName message as a xdstp:// URN string. + * + * @param resource_name resource name message. + * @param options encoding options. + * @return std::string xdstp:// URN for resource_name. + */ + static std::string encodeUrn(const xds::core::v3::ResourceName& resource_name, + const EncodeOptions& options); + static std::string encodeUrn(const xds::core::v3::ResourceName& resource_name) { + return encodeUrn(resource_name, {}); + } + + /** + * Encode a xds::core::v3::ResourceLocator message as a xdstp:// URL string. + * + * @param resource_name resource name message. + * @param options encoding options. + * @return std::string xdstp:// URL for resource_name. + */ + static std::string encodeUrl(const xds::core::v3::ResourceLocator& resource_locator, + const EncodeOptions& options); + static std::string encodeUrl(const xds::core::v3::ResourceLocator& resource_locator) { + return encodeUrl(resource_locator, {}); + } + + // Thrown when an exception occurs during URI decoding. + class DecodeException : public EnvoyException { + public: + DecodeException(const std::string& what) : EnvoyException(what) {} + }; + + /** + * Decode a xdstp:// URN string to a xds::core::v3::ResourceName. + * + * @param resource_urn xdstp:// resource URN. + * @return xds::core::v3::ResourceName resource name message for resource_urn. + * @throws DecodeException when parsing fails. + */ + static xds::core::v3::ResourceName decodeUrn(absl::string_view resource_urn); + + /** + * Decode a xdstp:// URL string to a xds::core::v3::ResourceLocator. + * + * @param resource_url xdstp:// resource URL. + * @return xds::core::v3::ResourceLocator resource name message for resource_url. + * @throws DecodeException when parsing fails. + */ + static xds::core::v3::ResourceLocator decodeUrl(absl::string_view resource_url); +}; + +} // namespace Config +} // namespace Envoy diff --git a/source/common/http/codec_client.h b/source/common/http/codec_client.h index 2e14b112a685..fb7bbfab2377 100644 --- a/source/common/http/codec_client.h +++ b/source/common/http/codec_client.h @@ -127,6 +127,7 @@ class CodecClient : Logger::Loggable, Type type() const { return type_; } + // Note this is the L4 stream info, not L7. const StreamInfo::StreamInfo& streamInfo() { return connection_->streamInfo(); } protected: diff --git a/source/common/http/conn_pool_base.cc b/source/common/http/conn_pool_base.cc index ff577eff4901..19c057a53edb 100644 --- a/source/common/http/conn_pool_base.cc +++ b/source/common/http/conn_pool_base.cc @@ -57,11 +57,6 @@ HttpConnPoolImplBase::HttpConnPoolImplBase( wrapTransportSocketOptions(transport_socket_options, protocols), state), random_generator_(random_generator) { ASSERT(!protocols.empty()); - // TODO(alyssawilk) the protocol function should probably be an optional and - // simply not set if there's more than one and ALPN has not been negotiated. - if (!protocols.empty()) { - protocol_ = protocols[0]; - } } HttpConnPoolImplBase::~HttpConnPoolImplBase() { destructAllConnections(); } @@ -95,7 +90,8 @@ void HttpConnPoolImplBase::onPoolReady(Envoy::ConnectionPool::ActiveClient& clie Http::ConnectionPool::Callbacks& callbacks = *http_context.callbacks_; Http::RequestEncoder& new_encoder = http_client->newStreamEncoder(response_decoder); callbacks.onPoolReady(new_encoder, client.real_host_description_, - http_client->codec_client_->streamInfo()); + http_client->codec_client_->streamInfo(), + http_client->codec_client_->protocol()); } } // namespace Http diff --git a/source/common/http/conn_pool_base.h b/source/common/http/conn_pool_base.h index 29c48af1127d..152dc6df86d5 100644 --- a/source/common/http/conn_pool_base.h +++ b/source/common/http/conn_pool_base.h @@ -65,7 +65,6 @@ class HttpConnPoolImplBase : public Envoy::ConnectionPool::ConnPoolImplBase, return Envoy::ConnectionPool::ConnPoolImplBase::maybePrefetch(ratio); } bool hasActiveConnections() const override; - Http::Protocol protocol() const override { return protocol_; } // Creates a new PendingStream and enqueues it into the queue. ConnectionPool::Cancellable* @@ -85,7 +84,6 @@ class HttpConnPoolImplBase : public Envoy::ConnectionPool::ConnPoolImplBase, protected: friend class ActiveClient; Random::RandomGenerator& random_generator_; - Http::Protocol protocol_; }; // An implementation of Envoy::ConnectionPool::ActiveClient for HTTP/1.1 and HTTP/2 diff --git a/source/common/router/upstream_request.cc b/source/common/router/upstream_request.cc index 57bcb5cc4fee..bf2536449df5 100644 --- a/source/common/router/upstream_request.cc +++ b/source/common/router/upstream_request.cc @@ -62,9 +62,6 @@ UpstreamRequest::UpstreamRequest(RouterFilterInterface& parent, } stream_info_.healthCheck(parent_.callbacks()->streamInfo().healthCheck()); - if (conn_pool_->protocol().has_value()) { - stream_info_.protocol(conn_pool_->protocol().value()); - } } UpstreamRequest::~UpstreamRequest() { @@ -351,7 +348,7 @@ void UpstreamRequest::onPoolFailure(ConnectionPool::PoolFailureReason reason, void UpstreamRequest::onPoolReady( std::unique_ptr&& upstream, Upstream::HostDescriptionConstSharedPtr host, const Network::Address::InstanceConstSharedPtr& upstream_local_address, - const StreamInfo::StreamInfo& info) { + const StreamInfo::StreamInfo& info, absl::optional protocol) { // This may be called under an existing ScopeTrackerScopeState but it will unwind correctly. ScopeTrackerScopeState scope(&parent_.callbacks()->scope(), parent_.callbacks()->dispatcher()); ENVOY_STREAM_LOG(debug, "pool ready", *parent_.callbacks()); @@ -368,6 +365,10 @@ void UpstreamRequest::onPoolReady( onUpstreamHostSelected(host); + if (protocol) { + stream_info_.protocol(protocol.value()); + } + stream_info_.setUpstreamFilterState(std::make_shared( info.filterState().parent()->parent(), StreamInfo::FilterState::LifeSpan::Request)); stream_info_.setUpstreamLocalAddress(upstream_local_address); @@ -401,7 +402,7 @@ void UpstreamRequest::onPoolReady( // Make sure that when we are forwarding CONNECT payload we do not do so until // the upstream has accepted the CONNECT request. - if (conn_pool_->protocol().has_value() && + if (protocol.has_value() && headers->getMethodValue() == Http::Headers::get().MethodValues.Connect) { paused_for_connect_ = true; } diff --git a/source/common/router/upstream_request.h b/source/common/router/upstream_request.h index 91f17f511239..5fc63dc212bf 100644 --- a/source/common/router/upstream_request.h +++ b/source/common/router/upstream_request.h @@ -77,7 +77,8 @@ class UpstreamRequest : public Logger::Loggable, void onPoolReady(std::unique_ptr&& upstream, Upstream::HostDescriptionConstSharedPtr host, const Network::Address::InstanceConstSharedPtr& upstream_local_address, - const StreamInfo::StreamInfo& info) override; + const StreamInfo::StreamInfo& info, + absl::optional protocol) override; UpstreamToDownstream& upstreamToDownstream() override { return *this; } void clearRequestEncoder(); diff --git a/source/common/tcp_proxy/upstream.cc b/source/common/tcp_proxy/upstream.cc index 128a7f769039..3b8dfec07165 100644 --- a/source/common/tcp_proxy/upstream.cc +++ b/source/common/tcp_proxy/upstream.cc @@ -220,7 +220,7 @@ void HttpConnPool::onPoolFailure(ConnectionPool::PoolFailureReason reason, absl: void HttpConnPool::onPoolReady(Http::RequestEncoder& request_encoder, Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo& info) { + const StreamInfo::StreamInfo& info, absl::optional) { upstream_handle_ = nullptr; Http::RequestEncoder* latched_encoder = &request_encoder; upstream_->setRequestEncoder(request_encoder, diff --git a/source/common/tcp_proxy/upstream.h b/source/common/tcp_proxy/upstream.h index 7a4da879187a..8d8a1ad8ef18 100644 --- a/source/common/tcp_proxy/upstream.h +++ b/source/common/tcp_proxy/upstream.h @@ -61,8 +61,8 @@ class HttpConnPool : public GenericConnPool, public Http::ConnectionPool::Callba absl::string_view transport_failure_reason, Upstream::HostDescriptionConstSharedPtr host) override; void onPoolReady(Http::RequestEncoder& request_encoder, - Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo& info) override; + Upstream::HostDescriptionConstSharedPtr host, const StreamInfo::StreamInfo& info, + absl::optional) override; private: const std::string hostname_; diff --git a/source/extensions/upstreams/http/http/upstream_request.cc b/source/extensions/upstreams/http/http/upstream_request.cc index d0e4f915020d..f41b081f8b18 100644 --- a/source/extensions/upstreams/http/http/upstream_request.cc +++ b/source/extensions/upstreams/http/http/upstream_request.cc @@ -47,10 +47,6 @@ bool HttpConnPool::cancelAnyPendingStream() { return false; } -absl::optional HttpConnPool::protocol() const { - return conn_pool_->protocol(); -} - void HttpConnPool::onPoolFailure(ConnectionPool::PoolFailureReason reason, absl::string_view transport_failure_reason, Upstream::HostDescriptionConstSharedPtr host) { @@ -60,12 +56,13 @@ void HttpConnPool::onPoolFailure(ConnectionPool::PoolFailureReason reason, void HttpConnPool::onPoolReady(Envoy::Http::RequestEncoder& request_encoder, Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo& info) { + const StreamInfo::StreamInfo& info, + absl::optional protocol) { conn_pool_stream_handle_ = nullptr; auto upstream = std::make_unique(callbacks_->upstreamToDownstream(), &request_encoder); callbacks_->onPoolReady(std::move(upstream), host, - request_encoder.getStream().connectionLocalAddress(), info); + request_encoder.getStream().connectionLocalAddress(), info, protocol); } } // namespace Http diff --git a/source/extensions/upstreams/http/http/upstream_request.h b/source/extensions/upstreams/http/http/upstream_request.h index 68cd57d0fae9..21de9e79275e 100644 --- a/source/extensions/upstreams/http/http/upstream_request.h +++ b/source/extensions/upstreams/http/http/upstream_request.h @@ -32,15 +32,14 @@ class HttpConnPool : public Router::GenericConnPool, public Envoy::Http::Connect } void newStream(Router::GenericConnectionPoolCallbacks* callbacks) override; bool cancelAnyPendingStream() override; - absl::optional protocol() const override; // Http::ConnectionPool::Callbacks void onPoolFailure(ConnectionPool::PoolFailureReason reason, absl::string_view transport_failure_reason, Upstream::HostDescriptionConstSharedPtr host) override; void onPoolReady(Envoy::Http::RequestEncoder& callbacks_encoder, - Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo& info) override; + Upstream::HostDescriptionConstSharedPtr host, const StreamInfo::StreamInfo& info, + absl::optional protocol) override; Upstream::HostDescriptionConstSharedPtr host() const override { return conn_pool_->host(); } bool valid() { return conn_pool_ != nullptr; } diff --git a/source/extensions/upstreams/http/tcp/upstream_request.cc b/source/extensions/upstreams/http/tcp/upstream_request.cc index 0c4dd46ece64..bc2f1b76f4b2 100644 --- a/source/extensions/upstreams/http/tcp/upstream_request.cc +++ b/source/extensions/upstreams/http/tcp/upstream_request.cc @@ -29,7 +29,7 @@ void TcpConnPool::onPoolReady(Envoy::Tcp::ConnectionPool::ConnectionDataPtr&& co auto upstream = std::make_unique(&callbacks_->upstreamToDownstream(), std::move(conn_data)); callbacks_->onPoolReady(std::move(upstream), host, latched_conn.localAddress(), - latched_conn.streamInfo()); + latched_conn.streamInfo(), {}); } TcpUpstream::TcpUpstream(Router::UpstreamToDownstream* upstream_request, diff --git a/source/extensions/upstreams/http/tcp/upstream_request.h b/source/extensions/upstreams/http/tcp/upstream_request.h index 3829fdead139..4623ec44f5f0 100644 --- a/source/extensions/upstreams/http/tcp/upstream_request.h +++ b/source/extensions/upstreams/http/tcp/upstream_request.h @@ -40,7 +40,6 @@ class TcpConnPool : public Router::GenericConnPool, public Envoy::Tcp::Connectio } return false; } - absl::optional protocol() const override { return absl::nullopt; } Upstream::HostDescriptionConstSharedPtr host() const override { return conn_pool_->host(); } bool valid() { return conn_pool_ != nullptr; } diff --git a/source/server/config_validation/server.h b/source/server/config_validation/server.h index 4909e5270f20..f35ec97bbd38 100644 --- a/source/server/config_validation/server.h +++ b/source/server/config_validation/server.h @@ -120,7 +120,7 @@ class ValidationInstance final : Logger::Loggable, // Server::ListenerComponentFactory LdsApiPtr createLdsApi(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator) override { + const xds::core::v3::ResourceLocator* lds_resources_locator) override { return std::make_unique(lds_config, lds_resources_locator, clusterManager(), initManager(), stats(), listenerManager(), messageValidationContext().dynamicValidationVisitor()); diff --git a/source/server/lds_api.cc b/source/server/lds_api.cc index d56c1338ec11..23198c8e3b9c 100644 --- a/source/server/lds_api.cc +++ b/source/server/lds_api.cc @@ -20,7 +20,7 @@ namespace Envoy { namespace Server { LdsApiImpl::LdsApiImpl(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator, + const xds::core::v3::ResourceLocator* lds_resources_locator, Upstream::ClusterManager& cm, Init::Manager& init_manager, Stats::Scope& scope, ListenerManager& lm, ProtobufMessage::ValidationVisitor& validation_visitor) diff --git a/source/server/lds_api.h b/source/server/lds_api.h index 333ba48551dd..3474a5038904 100644 --- a/source/server/lds_api.h +++ b/source/server/lds_api.h @@ -27,7 +27,7 @@ class LdsApiImpl : public LdsApi, Logger::Loggable { public: LdsApiImpl(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator, + const xds::core::v3::ResourceLocator* lds_resources_locator, Upstream::ClusterManager& cm, Init::Manager& init_manager, Stats::Scope& scope, ListenerManager& lm, ProtobufMessage::ValidationVisitor& validation_visitor); diff --git a/source/server/listener_manager_impl.h b/source/server/listener_manager_impl.h index af4e333c1adb..c29a0f8478ea 100644 --- a/source/server/listener_manager_impl.h +++ b/source/server/listener_manager_impl.h @@ -68,7 +68,7 @@ class ProdListenerComponentFactory : public ListenerComponentFactory, // Server::ListenerComponentFactory LdsApiPtr createLdsApi(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator) override { + const xds::core::v3::ResourceLocator* lds_resources_locator) override { return std::make_unique( lds_config, lds_resources_locator, server_.clusterManager(), server_.initManager(), server_.stats(), server_.listenerManager(), @@ -185,7 +185,7 @@ class ListenerManagerImpl : public ListenerManager, Logger::Loggable(R"EOF( + TestUtility::parseYaml(R"EOF( name: foo version: resource.1 resource: @@ -192,7 +192,7 @@ version: system.1 EXPECT_TRUE(statsAre(2, 1, 0, 0, 1471442407191366964, "system.1")); // Update. const auto inline_entry_2 = - TestUtility::parseYaml(R"EOF( + TestUtility::parseYaml(R"EOF( name: foo version: resource.2 resource: diff --git a/test/common/config/subscription_factory_impl_test.cc b/test/common/config/subscription_factory_impl_test.cc index f7a27a0da449..734aabb6499b 100644 --- a/test/common/config/subscription_factory_impl_test.cc +++ b/test/common/config/subscription_factory_impl_test.cc @@ -9,7 +9,7 @@ #include "envoy/stats/scope.h" #include "common/config/subscription_factory_impl.h" -#include "common/config/udpa_resource.h" +#include "common/config/xds_resource.h" #include "test/mocks/config/mocks.h" #include "test/mocks/event/mocks.h" @@ -49,8 +49,8 @@ class SubscriptionFactoryTest : public testing::Test { resource_decoder_); } - SubscriptionPtr collectionSubscriptionFromUrl(const std::string& udpa_url) { - const auto resource_locator = UdpaResourceIdentifier::decodeUrl(udpa_url); + SubscriptionPtr collectionSubscriptionFromUrl(const std::string& xds_url) { + const auto resource_locator = XdsResourceIdentifier::decodeUrl(xds_url); return subscription_factory_.collectionSubscriptionFromUrl( resource_locator, {}, Config::TypeUrl::get().ClusterLoadAssignment, stats_store_, callbacks_, resource_decoder_); diff --git a/test/common/config/udpa_resource_test.cc b/test/common/config/udpa_resource_test.cc deleted file mode 100644 index b9629588c4a6..000000000000 --- a/test/common/config/udpa_resource_test.cc +++ /dev/null @@ -1,181 +0,0 @@ -#include "common/config/udpa_resource.h" - -#include "test/common/config/udpa_test_utility.h" -#include "test/test_common/utility.h" - -#include "gtest/gtest.h" - -using ::testing::ElementsAre; -using ::testing::Pair; - -namespace Envoy { -namespace Config { -namespace { - -const std::string EscapedUrn = - "udpa://f123%25%2F%3F%23o/envoy.config.listener.v3.Listener/b%25%3A%2F%3F%23%5B%5Dar//" - "baz?%25%23%5B%5D%26%3Dab=cde%25%23%5B%5D%26%3Df"; -const std::string EscapedUrnWithManyQueryParams = - "udpa://f123%25%2F%3F%23o/envoy.config.listener.v3.Listener/b%25%3A%2F%3F%23%5B%5Dar//" - "baz?%25%23%5B%5D%26%3D=bar&%25%23%5B%5D%26%3Dab=cde%25%23%5B%5D%26%3Df&foo=%25%23%5B%5D%26%3D"; -const std::string EscapedUrlWithManyQueryParamsAndDirectives = - EscapedUrnWithManyQueryParams + - "#entry=some_en%25%23%5B%5D%2Ctry,alt=udpa://fo%2525%252F%253F%2523o/bar%23alt=udpa://bar/" - "baz%2Centry=h%2525%2523%255B%255D%252Cuh"; - -// for all x. encodeUri(decodeUri(x)) = x where x comes from sample of valid udpa:// URIs. -// TODO(htuch): write a fuzzer that validates this property as well. -TEST(UdpaResourceIdentifierTest, DecodeEncode) { - const std::vector uris = { - "udpa:///envoy.config.listener.v3.Listener", - "udpa://foo/envoy.config.listener.v3.Listener", - "udpa://foo/envoy.config.listener.v3.Listener/bar", - "udpa://foo/envoy.config.listener.v3.Listener/bar/baz", - "udpa://foo/envoy.config.listener.v3.Listener/bar////baz", - "udpa://foo/envoy.config.listener.v3.Listener?ab=cde", - "udpa://foo/envoy.config.listener.v3.Listener/bar?ab=cd", - "udpa://foo/envoy.config.listener.v3.Listener/bar/baz?ab=cde", - "udpa://foo/envoy.config.listener.v3.Listener/bar/baz?ab=", - "udpa://foo/envoy.config.listener.v3.Listener/bar/baz?=cd", - "udpa://foo/envoy.config.listener.v3.Listener/bar/baz?ab=cde&ba=edc&z=f", - EscapedUrn, - EscapedUrnWithManyQueryParams, - }; - UdpaResourceIdentifier::EncodeOptions encode_options; - encode_options.sort_context_params_ = true; - for (const std::string& uri : uris) { - EXPECT_EQ(uri, UdpaResourceIdentifier::encodeUrn(UdpaResourceIdentifier::decodeUrn(uri), - encode_options)); - EXPECT_EQ(uri, UdpaResourceIdentifier::encodeUrl(UdpaResourceIdentifier::decodeUrl(uri), - encode_options)); - } -} - -// Validate that URN decoding behaves as expected component-wise. -TEST(UdpaResourceNameTest, DecodeSuccess) { - const auto resource_name = UdpaResourceIdentifier::decodeUrn(EscapedUrnWithManyQueryParams); - EXPECT_EQ("f123%/?#o", resource_name.authority()); - EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.resource_type()); - EXPECT_THAT(resource_name.id(), ElementsAre("b%:/?#[]ar", "", "baz")); - EXPECT_CONTEXT_PARAMS(resource_name.context(), Pair("%#[]&=", "bar"), - Pair("%#[]&=ab", "cde%#[]&=f"), Pair("foo", "%#[]&=")); -} - -// Validate that URL decoding behaves as expected component-wise. -TEST(UdpaResourceLocatorTest, DecodeSuccess) { - const auto resource_locator = - UdpaResourceIdentifier::decodeUrl(EscapedUrlWithManyQueryParamsAndDirectives); - EXPECT_EQ("f123%/?#o", resource_locator.authority()); - EXPECT_EQ("envoy.config.listener.v3.Listener", resource_locator.resource_type()); - EXPECT_THAT(resource_locator.id(), ElementsAre("b%:/?#[]ar", "", "baz")); - EXPECT_CONTEXT_PARAMS(resource_locator.exact_context(), Pair("%#[]&=", "bar"), - Pair("%#[]&=ab", "cde%#[]&=f"), Pair("foo", "%#[]&=")); - EXPECT_EQ(2, resource_locator.directives().size()); - EXPECT_EQ("some_en%#[],try", resource_locator.directives()[0].entry()); - const auto& alt = resource_locator.directives()[1].alt(); - EXPECT_EQ("fo%/?#o", alt.authority()); - EXPECT_EQ("bar", alt.resource_type()); - EXPECT_EQ(2, alt.directives().size()); - const auto& inner_alt = alt.directives()[0].alt(); - EXPECT_EQ("bar", inner_alt.authority()); - EXPECT_EQ("baz", inner_alt.resource_type()); - EXPECT_EQ("h%#[],uh", alt.directives()[1].entry()); -} - -// Validate that the URN decoding behaves with a near-empty UDPA resource name. -TEST(UdpaResourceLocatorTest, DecodeEmpty) { - const auto resource_name = - UdpaResourceIdentifier::decodeUrn("udpa:///envoy.config.listener.v3.Listener"); - EXPECT_TRUE(resource_name.authority().empty()); - EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.resource_type()); - EXPECT_TRUE(resource_name.id().empty()); - EXPECT_TRUE(resource_name.context().params().empty()); -} - -// Validate that the URL decoding behaves with a near-empty UDPA resource locator. -TEST(UdpaResourceNameTest, DecodeEmpty) { - const auto resource_locator = - UdpaResourceIdentifier::decodeUrl("udpa:///envoy.config.listener.v3.Listener"); - EXPECT_TRUE(resource_locator.authority().empty()); - EXPECT_EQ("envoy.config.listener.v3.Listener", resource_locator.resource_type()); - EXPECT_TRUE(resource_locator.id().empty()); - EXPECT_TRUE(resource_locator.exact_context().params().empty()); - EXPECT_TRUE(resource_locator.directives().empty()); -} - -// Negative tests for URN decoding. -TEST(UdpaResourceNameTest, DecodeFail) { - { - EXPECT_THROW_WITH_MESSAGE(UdpaResourceIdentifier::decodeUrn("foo://"), - UdpaResourceIdentifier::DecodeException, - "foo:// does not have an udpa: scheme"); - } - { - EXPECT_THROW_WITH_MESSAGE(UdpaResourceIdentifier::decodeUrn("udpa://foo"), - UdpaResourceIdentifier::DecodeException, - "Resource type missing from /"); - } -} - -// Negative tests for URL decoding. -TEST(UdpaResourceLocatorTest, DecodeFail) { - { - EXPECT_THROW_WITH_MESSAGE(UdpaResourceIdentifier::decodeUrl("foo://"), - UdpaResourceIdentifier::DecodeException, - "foo:// does not have a udpa:, http: or file: scheme"); - } - { - EXPECT_THROW_WITH_MESSAGE(UdpaResourceIdentifier::decodeUrl("udpa://foo"), - UdpaResourceIdentifier::DecodeException, - "Resource type missing from /"); - } - { - EXPECT_THROW_WITH_MESSAGE(UdpaResourceIdentifier::decodeUrl("udpa://foo/some-type#bar=baz"), - UdpaResourceIdentifier::DecodeException, - "Unknown fragment component bar=baz"); - } -} - -// Validate parsing for udpa:, http: and file: schemes. -TEST(UdpaResourceLocatorTest, Schemes) { - { - const auto resource_locator = - UdpaResourceIdentifier::decodeUrl("udpa://foo/bar/baz/blah?a=b#entry=m"); - EXPECT_EQ(udpa::core::v1::ResourceLocator::UDPA, resource_locator.scheme()); - EXPECT_EQ("foo", resource_locator.authority()); - EXPECT_EQ("bar", resource_locator.resource_type()); - EXPECT_THAT(resource_locator.id(), ElementsAre("baz", "blah")); - EXPECT_CONTEXT_PARAMS(resource_locator.exact_context(), Pair("a", "b")); - EXPECT_EQ(1, resource_locator.directives().size()); - EXPECT_EQ("m", resource_locator.directives()[0].entry()); - EXPECT_EQ("udpa://foo/bar/baz/blah?a=b#entry=m", - UdpaResourceIdentifier::encodeUrl(resource_locator)); - } - { - const auto resource_locator = - UdpaResourceIdentifier::decodeUrl("http://foo/bar/baz/blah?a=b#entry=m"); - EXPECT_EQ(udpa::core::v1::ResourceLocator::HTTP, resource_locator.scheme()); - EXPECT_EQ("foo", resource_locator.authority()); - EXPECT_EQ("bar", resource_locator.resource_type()); - EXPECT_THAT(resource_locator.id(), ElementsAre("baz", "blah")); - EXPECT_CONTEXT_PARAMS(resource_locator.exact_context(), Pair("a", "b")); - EXPECT_EQ(1, resource_locator.directives().size()); - EXPECT_EQ("m", resource_locator.directives()[0].entry()); - EXPECT_EQ("http://foo/bar/baz/blah?a=b#entry=m", - UdpaResourceIdentifier::encodeUrl(resource_locator)); - } - { - const auto resource_locator = UdpaResourceIdentifier::decodeUrl("file:///bar/baz/blah#entry=m"); - EXPECT_EQ(udpa::core::v1::ResourceLocator::FILE, resource_locator.scheme()); - EXPECT_THAT(resource_locator.id(), ElementsAre("bar", "baz", "blah")); - EXPECT_EQ(1, resource_locator.directives().size()); - EXPECT_EQ("m", resource_locator.directives()[0].entry()); - EXPECT_EQ("file:///bar/baz/blah#entry=m", UdpaResourceIdentifier::encodeUrl(resource_locator)); - } -} - -// extra tests for fragment handling - -} // namespace -} // namespace Config -} // namespace Envoy diff --git a/test/common/config/udpa_context_params_test.cc b/test/common/config/xds_context_params_test.cc similarity index 51% rename from test/common/config/udpa_context_params_test.cc rename to test/common/config/xds_context_params_test.cc index 98ea4b758053..dbcf29a2c70b 100644 --- a/test/common/config/udpa_context_params_test.cc +++ b/test/common/config/xds_context_params_test.cc @@ -1,11 +1,11 @@ -#include "common/config/udpa_context_params.h" +#include "common/config/xds_context_params.h" -#include "test/common/config/udpa_test_utility.h" +#include "test/common/config/xds_test_utility.h" #include "test/test_common/logging.h" #include "test/test_common/utility.h" #include "gtest/gtest.h" -#include "udpa_test_utility.h" +#include "xds_test_utility.h" using ::testing::Pair; @@ -15,7 +15,7 @@ namespace { // Validate all the node parameter renderers (except user_agent_build_version, which has its own // test below). -TEST(UdpaContextParamsTest, NodeAll) { +TEST(XdsContextParamsTest, NodeAll) { envoy::config::core::v3::Node node; TestUtility::loadFromYaml(R"EOF( id: some_id @@ -32,23 +32,22 @@ TEST(UdpaContextParamsTest, NodeAll) { baz: 42 )EOF", node); - const auto context_params = UdpaContextParams::encode( + const auto context_params = XdsContextParams::encode( node, {"id", "cluster", "user_agent_name", "user_agent_version", "locality.region", "locality.zone", "locality.sub_zone", "metadata"}, {}, {}, {}); EXPECT_CONTEXT_PARAMS( - context_params, Pair("udpa.node.cluster", "some_cluster"), Pair("udpa.node.id", "some_id"), - Pair("udpa.node.locality.sub_zone", "some_sub_zone"), - Pair("udpa.node.locality.zone", "some_zone"), - Pair("udpa.node.locality.region", "some_region"), Pair("udpa.node.metadata.bar", "\"a\""), - Pair("udpa.node.metadata.baz", "42"), Pair("udpa.node.metadata.foo", "true"), - Pair("udpa.node.user_agent_name", "xds_client"), - Pair("udpa.node.user_agent_version", "1.2.3")); + context_params, Pair("xds.node.cluster", "some_cluster"), Pair("xds.node.id", "some_id"), + Pair("xds.node.locality.sub_zone", "some_sub_zone"), + Pair("xds.node.locality.zone", "some_zone"), Pair("xds.node.locality.region", "some_region"), + Pair("xds.node.metadata.bar", "\"a\""), Pair("xds.node.metadata.baz", "42"), + Pair("xds.node.metadata.foo", "true"), Pair("xds.node.user_agent_name", "xds_client"), + Pair("xds.node.user_agent_version", "1.2.3")); } // Validate that we can select a subset of node parameters. -TEST(UdpaContextParamsTest, NodeParameterSelection) { +TEST(XdsContextParamsTest, NodeParameterSelection) { envoy::config::core::v3::Node node; TestUtility::loadFromYaml(R"EOF( id: some_id @@ -65,16 +64,16 @@ TEST(UdpaContextParamsTest, NodeParameterSelection) { baz: 42 )EOF", node); - const auto context_params = UdpaContextParams::encode( + const auto context_params = XdsContextParams::encode( node, {"cluster", "user_agent_version", "locality.region", "locality.sub_zone"}, {}, {}, {}); - EXPECT_CONTEXT_PARAMS(context_params, Pair("udpa.node.cluster", "some_cluster"), - Pair("udpa.node.locality.sub_zone", "some_sub_zone"), - Pair("udpa.node.locality.region", "some_region"), - Pair("udpa.node.user_agent_version", "1.2.3")); + EXPECT_CONTEXT_PARAMS(context_params, Pair("xds.node.cluster", "some_cluster"), + Pair("xds.node.locality.sub_zone", "some_sub_zone"), + Pair("xds.node.locality.region", "some_region"), + Pair("xds.node.user_agent_version", "1.2.3")); } // Validate user_agent_build_version renderers. -TEST(UdpaContextParamsTest, NodeUserAgentBuildVersion) { +TEST(XdsContextParamsTest, NodeUserAgentBuildVersion) { envoy::config::core::v3::Node node; TestUtility::loadFromYaml(R"EOF( user_agent_build_version: @@ -88,18 +87,18 @@ TEST(UdpaContextParamsTest, NodeUserAgentBuildVersion) { baz: 42 )EOF", node); - const auto context_params = UdpaContextParams::encode( + const auto context_params = XdsContextParams::encode( node, {"user_agent_build_version.version", "user_agent_build_version.metadata"}, {}, {}, {}); EXPECT_CONTEXT_PARAMS(context_params, - Pair("udpa.node.user_agent_build_version.metadata.bar", "\"a\""), - Pair("udpa.node.user_agent_build_version.metadata.baz", "42"), - Pair("udpa.node.user_agent_build_version.metadata.foo", "true"), - Pair("udpa.node.user_agent_build_version.version", "1.2.3")); + Pair("xds.node.user_agent_build_version.metadata.bar", "\"a\""), + Pair("xds.node.user_agent_build_version.metadata.baz", "42"), + Pair("xds.node.user_agent_build_version.metadata.foo", "true"), + Pair("xds.node.user_agent_build_version.version", "1.2.3")); } // Validate that resource locator context parameters are pass-thru. -TEST(UdpaContextParamsTest, ResoureContextParams) { - udpa::core::v1::ContextParams resource_context_params; +TEST(XdsContextParamsTest, ResoureContextParams) { + xds::core::v3::ContextParams resource_context_params; TestUtility::loadFromYaml(R"EOF( params: foo: "\"some_string\"" @@ -107,48 +106,48 @@ TEST(UdpaContextParamsTest, ResoureContextParams) { baz: "true" )EOF", resource_context_params); - const auto context_params = UdpaContextParams::encode({}, {}, resource_context_params, {}, {}); + const auto context_params = XdsContextParams::encode({}, {}, resource_context_params, {}, {}); EXPECT_CONTEXT_PARAMS(context_params, Pair("bar", "123"), Pair("baz", "true"), Pair("foo", "\"some_string\"")); } // Validate client feature capabilities context parameter transform. -TEST(UdpaContextParamsTest, ClientFeatureCapabilities) { +TEST(XdsContextParamsTest, ClientFeatureCapabilities) { const auto context_params = - UdpaContextParams::encode({}, {}, {}, {"some.feature", "another.feature"}, {}); - EXPECT_CONTEXT_PARAMS(context_params, Pair("udpa.client_feature.another.feature", "true"), - Pair("udpa.client_feature.some.feature", "true")); + XdsContextParams::encode({}, {}, {}, {"some.feature", "another.feature"}, {}); + EXPECT_CONTEXT_PARAMS(context_params, Pair("xds.client_feature.another.feature", "true"), + Pair("xds.client_feature.some.feature", "true")); } // Validate per-resource well-known attributes transform. -TEST(UdpaContextParamsTest, ResourceWktAttribs) { +TEST(XdsContextParamsTest, ResourceWktAttribs) { const auto context_params = - UdpaContextParams::encode({}, {}, {}, {}, {{"foo", "1"}, {"bar", "2"}}); - EXPECT_CONTEXT_PARAMS(context_params, Pair("udpa.resource.foo", "1"), - Pair("udpa.resource.bar", "2")); + XdsContextParams::encode({}, {}, {}, {}, {{"foo", "1"}, {"bar", "2"}}); + EXPECT_CONTEXT_PARAMS(context_params, Pair("xds.resource.foo", "1"), + Pair("xds.resource.bar", "2")); } // Validate that the precedence relationships in the specification hold. -TEST(UdpaContextParamsTest, Layering) { +TEST(XdsContextParamsTest, Layering) { envoy::config::core::v3::Node node; TestUtility::loadFromYaml(R"EOF( id: some_id cluster: some_cluster )EOF", node); - udpa::core::v1::ContextParams resource_context_params; + xds::core::v3::ContextParams resource_context_params; TestUtility::loadFromYaml(R"EOF( params: id: another_id - udpa.node.cluster: another_cluster + xds.node.cluster: another_cluster )EOF", resource_context_params); - const auto context_params = UdpaContextParams::encode( + const auto context_params = XdsContextParams::encode( node, {"id", "cluster"}, resource_context_params, {"id"}, {{"cluster", "huh"}}); EXPECT_CONTEXT_PARAMS(context_params, Pair("id", "another_id"), - Pair("udpa.client_feature.id", "true"), - Pair("udpa.node.cluster", "another_cluster"), - Pair("udpa.node.id", "some_id"), Pair("udpa.resource.cluster", "huh")); + Pair("xds.client_feature.id", "true"), + Pair("xds.node.cluster", "another_cluster"), Pair("xds.node.id", "some_id"), + Pair("xds.resource.cluster", "huh")); } } // namespace diff --git a/test/common/config/xds_resource_test.cc b/test/common/config/xds_resource_test.cc new file mode 100644 index 000000000000..4331f69d783f --- /dev/null +++ b/test/common/config/xds_resource_test.cc @@ -0,0 +1,194 @@ +#include "common/config/xds_resource.h" + +#include "test/common/config/xds_test_utility.h" +#include "test/test_common/utility.h" + +#include "gtest/gtest.h" + +using ::testing::Pair; + +namespace Envoy { +namespace Config { +namespace { + +const std::string EscapedUrn = + "xdstp://f123%25%2F%3F%23o/envoy.config.listener.v3.Listener/b%25%3A%3F%23%5B%5Dar//" + "baz?%25%23%5B%5D%26%3Dab=cde%25%23%5B%5D%26%3Df"; +const std::string EscapedUrnWithManyQueryParams = + "xdstp://f123%25%2F%3F%23o/envoy.config.listener.v3.Listener/b%25%3A%3F%23%5B%5Dar//" + "baz?%25%23%5B%5D%26%3D=bar&%25%23%5B%5D%26%3Dab=cde%25%23%5B%5D%26%3Df&foo=%25%23%5B%5D%26%3D"; +const std::string EscapedUrlWithManyQueryParamsAndDirectives = + EscapedUrnWithManyQueryParams + + "#entry=some_en%25%23%5B%5D%2Ctry,alt=xdstp://fo%2525%252F%253F%2523o/bar%23alt=xdstp://bar/" + "baz%2Centry=h%2525%2523%255B%255D%252Cuh"; + +// for all x. encodeUri(decodeUri(x)) = x where x comes from sample of valid xdstp:// URIs. +// TODO(htuch): write a fuzzer that validates this property as well. +TEST(XdsResourceIdentifierTest, DecodeEncode) { + const std::vector uris = { + "xdstp:///envoy.config.listener.v3.Listener", + "xdstp://foo/envoy.config.listener.v3.Listener", + "xdstp://foo/envoy.config.listener.v3.Listener/bar", + "xdstp://foo/envoy.config.listener.v3.Listener/bar/baz", + "xdstp://foo/envoy.config.listener.v3.Listener/bar////baz", + "xdstp://foo/envoy.config.listener.v3.Listener?ab=cde", + "xdstp://foo/envoy.config.listener.v3.Listener/bar?ab=cd", + "xdstp://foo/envoy.config.listener.v3.Listener/bar/baz?ab=cde", + "xdstp://foo/envoy.config.listener.v3.Listener/bar/baz?ab=", + "xdstp://foo/envoy.config.listener.v3.Listener/bar/baz?=cd", + "xdstp://foo/envoy.config.listener.v3.Listener/bar/baz?ab=cde&ba=edc&z=f", + EscapedUrn, + EscapedUrnWithManyQueryParams, + }; + XdsResourceIdentifier::EncodeOptions encode_options; + encode_options.sort_context_params_ = true; + for (const std::string& uri : uris) { + EXPECT_EQ(uri, XdsResourceIdentifier::encodeUrn(XdsResourceIdentifier::decodeUrn(uri), + encode_options)); + EXPECT_EQ(uri, XdsResourceIdentifier::encodeUrl(XdsResourceIdentifier::decodeUrl(uri), + encode_options)); + } +} + +// Corner cases around path-identifier encoding/decoding. +TEST(XdsResourceIdentifierTest, PathDividerEscape) { + { + const auto resource_name = XdsResourceIdentifier::decodeUrn("xdstp:///type/foo%2Fbar/baz"); + EXPECT_EQ("foo/bar/baz", resource_name.id()); + EXPECT_EQ("xdstp:///type/foo/bar/baz", XdsResourceIdentifier::encodeUrn(resource_name)); + } + { + const auto resource_locator = XdsResourceIdentifier::decodeUrl("xdstp:///type/foo%2Fbar/baz"); + EXPECT_EQ("foo/bar/baz", resource_locator.id()); + EXPECT_EQ("xdstp:///type/foo/bar/baz", XdsResourceIdentifier::encodeUrl(resource_locator)); + } +} + +// Validate that URN decoding behaves as expected component-wise. +TEST(XdsResourceNameTest, DecodeSuccess) { + const auto resource_name = XdsResourceIdentifier::decodeUrn(EscapedUrnWithManyQueryParams); + EXPECT_EQ("f123%/?#o", resource_name.authority()); + EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.resource_type()); + EXPECT_EQ(resource_name.id(), "b%:?#[]ar//baz"); + EXPECT_CONTEXT_PARAMS(resource_name.context(), Pair("%#[]&=", "bar"), + Pair("%#[]&=ab", "cde%#[]&=f"), Pair("foo", "%#[]&=")); +} + +// Validate that URL decoding behaves as expected component-wise. +TEST(XdsResourceLocatorTest, DecodeSuccess) { + const auto resource_locator = + XdsResourceIdentifier::decodeUrl(EscapedUrlWithManyQueryParamsAndDirectives); + EXPECT_EQ("f123%/?#o", resource_locator.authority()); + EXPECT_EQ("envoy.config.listener.v3.Listener", resource_locator.resource_type()); + EXPECT_EQ(resource_locator.id(), "b%:?#[]ar//baz"); + EXPECT_CONTEXT_PARAMS(resource_locator.exact_context(), Pair("%#[]&=", "bar"), + Pair("%#[]&=ab", "cde%#[]&=f"), Pair("foo", "%#[]&=")); + EXPECT_EQ(2, resource_locator.directives().size()); + EXPECT_EQ("some_en%#[],try", resource_locator.directives()[0].entry()); + const auto& alt = resource_locator.directives()[1].alt(); + EXPECT_EQ("fo%/?#o", alt.authority()); + EXPECT_EQ("bar", alt.resource_type()); + EXPECT_EQ(2, alt.directives().size()); + const auto& inner_alt = alt.directives()[0].alt(); + EXPECT_EQ("bar", inner_alt.authority()); + EXPECT_EQ("baz", inner_alt.resource_type()); + EXPECT_EQ("h%#[],uh", alt.directives()[1].entry()); +} + +// Validate that the URN decoding behaves with a near-empty xDS resource name. +TEST(XdsResourceLocatorTest, DecodeEmpty) { + const auto resource_name = + XdsResourceIdentifier::decodeUrn("xdstp:///envoy.config.listener.v3.Listener"); + EXPECT_TRUE(resource_name.authority().empty()); + EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.resource_type()); + EXPECT_TRUE(resource_name.id().empty()); + EXPECT_TRUE(resource_name.context().params().empty()); +} + +// Validate that the URL decoding behaves with a near-empty xDS resource locator. +TEST(XdsResourceNameTest, DecodeEmpty) { + const auto resource_locator = + XdsResourceIdentifier::decodeUrl("xdstp:///envoy.config.listener.v3.Listener"); + EXPECT_TRUE(resource_locator.authority().empty()); + EXPECT_EQ("envoy.config.listener.v3.Listener", resource_locator.resource_type()); + EXPECT_TRUE(resource_locator.id().empty()); + EXPECT_TRUE(resource_locator.exact_context().params().empty()); + EXPECT_TRUE(resource_locator.directives().empty()); +} + +// Negative tests for URN decoding. +TEST(XdsResourceNameTest, DecodeFail) { + { + EXPECT_THROW_WITH_MESSAGE(XdsResourceIdentifier::decodeUrn("foo://"), + XdsResourceIdentifier::DecodeException, + "foo:// does not have an xdstp: scheme"); + } + { + EXPECT_THROW_WITH_MESSAGE(XdsResourceIdentifier::decodeUrn("xdstp://foo"), + XdsResourceIdentifier::DecodeException, + "Resource type missing from /"); + } +} + +// Negative tests for URL decoding. +TEST(XdsResourceLocatorTest, DecodeFail) { + { + EXPECT_THROW_WITH_MESSAGE(XdsResourceIdentifier::decodeUrl("foo://"), + XdsResourceIdentifier::DecodeException, + "foo:// does not have a xdstp:, http: or file: scheme"); + } + { + EXPECT_THROW_WITH_MESSAGE(XdsResourceIdentifier::decodeUrl("xdstp://foo"), + XdsResourceIdentifier::DecodeException, + "Resource type missing from /"); + } + { + EXPECT_THROW_WITH_MESSAGE(XdsResourceIdentifier::decodeUrl("xdstp://foo/some-type#bar=baz"), + XdsResourceIdentifier::DecodeException, + "Unknown fragment component bar=baz"); + } +} + +// Validate parsing for xdstp:, http: and file: schemes. +TEST(XdsResourceLocatorTest, Schemes) { + { + const auto resource_locator = + XdsResourceIdentifier::decodeUrl("xdstp://foo/bar/baz/blah?a=b#entry=m"); + EXPECT_EQ(xds::core::v3::ResourceLocator::XDSTP, resource_locator.scheme()); + EXPECT_EQ("foo", resource_locator.authority()); + EXPECT_EQ("bar", resource_locator.resource_type()); + EXPECT_EQ(resource_locator.id(), "baz/blah"); + EXPECT_CONTEXT_PARAMS(resource_locator.exact_context(), Pair("a", "b")); + EXPECT_EQ(1, resource_locator.directives().size()); + EXPECT_EQ("m", resource_locator.directives()[0].entry()); + EXPECT_EQ("xdstp://foo/bar/baz/blah?a=b#entry=m", + XdsResourceIdentifier::encodeUrl(resource_locator)); + } + { + const auto resource_locator = + XdsResourceIdentifier::decodeUrl("http://foo/bar/baz/blah?a=b#entry=m"); + EXPECT_EQ(xds::core::v3::ResourceLocator::HTTP, resource_locator.scheme()); + EXPECT_EQ("foo", resource_locator.authority()); + EXPECT_EQ("bar", resource_locator.resource_type()); + EXPECT_EQ(resource_locator.id(), "baz/blah"); + EXPECT_CONTEXT_PARAMS(resource_locator.exact_context(), Pair("a", "b")); + EXPECT_EQ(1, resource_locator.directives().size()); + EXPECT_EQ("m", resource_locator.directives()[0].entry()); + EXPECT_EQ("http://foo/bar/baz/blah?a=b#entry=m", + XdsResourceIdentifier::encodeUrl(resource_locator)); + } + { + const auto resource_locator = XdsResourceIdentifier::decodeUrl("file:///bar/baz/blah#entry=m"); + EXPECT_EQ(xds::core::v3::ResourceLocator::FILE, resource_locator.scheme()); + EXPECT_EQ(resource_locator.id(), "bar/baz/blah"); + EXPECT_EQ(1, resource_locator.directives().size()); + EXPECT_EQ("m", resource_locator.directives()[0].entry()); + EXPECT_EQ("file:///bar/baz/blah#entry=m", XdsResourceIdentifier::encodeUrl(resource_locator)); + } +} + +// extra tests for fragment handling + +} // namespace +} // namespace Config +} // namespace Envoy diff --git a/test/common/config/udpa_test_utility.h b/test/common/config/xds_test_utility.h similarity index 100% rename from test/common/config/udpa_test_utility.h rename to test/common/config/xds_test_utility.h diff --git a/test/common/http/async_client_impl_test.cc b/test/common/http/async_client_impl_test.cc index d47719351501..c8aeb6fe81f5 100644 --- a/test/common/http/async_client_impl_test.cc +++ b/test/common/http/async_client_impl_test.cc @@ -117,7 +117,7 @@ TEST_F(AsyncClientImplTest, BasicStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -161,7 +161,7 @@ TEST_F(AsyncClientImplTest, Basic) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -199,7 +199,7 @@ TEST_F(AsyncClientImplTracingTest, Basic) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -244,7 +244,7 @@ TEST_F(AsyncClientImplTracingTest, BasicNamedChildSpan) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -290,7 +290,7 @@ TEST_F(AsyncClientImplTest, BasicHashPolicy) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -337,7 +337,7 @@ TEST_F(AsyncClientImplTest, Retry) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -359,7 +359,7 @@ TEST_F(AsyncClientImplTest, Retry) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -382,7 +382,7 @@ TEST_F(AsyncClientImplTest, RetryWithStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -407,7 +407,7 @@ TEST_F(AsyncClientImplTest, RetryWithStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -430,7 +430,7 @@ TEST_F(AsyncClientImplTest, MultipleStreams) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -456,7 +456,7 @@ TEST_F(AsyncClientImplTest, MultipleStreams) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder2, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder2, cm_.conn_pool_.host_, stream_info_, {}); response_decoder2 = &decoder; return nullptr; })); @@ -490,7 +490,7 @@ TEST_F(AsyncClientImplTest, MultipleRequests) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -510,7 +510,7 @@ TEST_F(AsyncClientImplTest, MultipleRequests) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder2, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder2, cm_.conn_pool_.host_, stream_info_, {}); response_decoder2 = &decoder; return nullptr; })); @@ -528,7 +528,7 @@ TEST_F(AsyncClientImplTest, MultipleRequests) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder3, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder3, cm_.conn_pool_.host_, stream_info_, {}); response_decoder3 = &decoder; return nullptr; })); @@ -578,7 +578,7 @@ TEST_F(AsyncClientImplTest, StreamAndRequest) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -597,7 +597,7 @@ TEST_F(AsyncClientImplTest, StreamAndRequest) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder2, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder2, cm_.conn_pool_.host_, stream_info_, {}); response_decoder2 = &decoder; return nullptr; })); @@ -636,7 +636,7 @@ TEST_F(AsyncClientImplTest, StreamWithTrailers) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -670,7 +670,7 @@ TEST_F(AsyncClientImplTest, Trailers) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -693,7 +693,7 @@ TEST_F(AsyncClientImplTest, ImmediateReset) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -716,7 +716,7 @@ TEST_F(AsyncClientImplTest, LocalResetAfterStreamStart) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -752,7 +752,7 @@ TEST_F(AsyncClientImplTest, SendDataAfterRemoteClosure) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -787,7 +787,7 @@ TEST_F(AsyncClientImplTest, SendTrailersRemoteClosure) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -827,7 +827,7 @@ TEST_F(AsyncClientImplTest, ResetInOnHeaders) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -863,7 +863,7 @@ TEST_F(AsyncClientImplTest, RemoteResetAfterStreamStart) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -897,7 +897,7 @@ TEST_F(AsyncClientImplTest, ResetAfterResponseStart) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); @@ -925,7 +925,7 @@ TEST_F(AsyncClientImplTest, ResetStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -942,7 +942,7 @@ TEST_F(AsyncClientImplTest, CancelRequest) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -960,7 +960,7 @@ TEST_F(AsyncClientImplTracingTest, CancelRequest) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -998,7 +998,7 @@ TEST_F(AsyncClientImplTest, DestroyWithActiveStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1013,7 +1013,7 @@ TEST_F(AsyncClientImplTest, DestroyWithActiveRequest) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); EXPECT_CALL(stream_encoder_, encodeHeaders(HeaderMapEqualRef(&message_->headers()), true)); @@ -1038,7 +1038,7 @@ TEST_F(AsyncClientImplTracingTest, DestroyWithActiveRequest) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1128,7 +1128,7 @@ TEST_F(AsyncClientImplTest, StreamTimeout) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1161,7 +1161,7 @@ TEST_F(AsyncClientImplTest, StreamTimeoutHeadReply) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1187,7 +1187,7 @@ TEST_F(AsyncClientImplTest, RequestTimeout) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1218,7 +1218,7 @@ TEST_F(AsyncClientImplTracingTest, RequestTimeout) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1259,7 +1259,7 @@ TEST_F(AsyncClientImplTest, DisableTimer) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1279,7 +1279,7 @@ TEST_F(AsyncClientImplTest, DisableTimerWithStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](StreamDecoder&, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); return nullptr; })); @@ -1303,7 +1303,7 @@ TEST_F(AsyncClientImplTest, MultipleDataStream) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](ResponseDecoder& decoder, ConnectionPool::Callbacks& callbacks) -> ConnectionPool::Cancellable* { - callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_); + callbacks.onPoolReady(stream_encoder_, cm_.conn_pool_.host_, stream_info_, {}); response_decoder_ = &decoder; return nullptr; })); diff --git a/test/common/http/common.h b/test/common/http/common.h index 2cd5a9db335b..dd07fc25d898 100644 --- a/test/common/http/common.h +++ b/test/common/http/common.h @@ -39,7 +39,7 @@ class CodecClientForTest : public Http::CodecClient { */ struct ConnPoolCallbacks : public Http::ConnectionPool::Callbacks { void onPoolReady(Http::RequestEncoder& encoder, Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo&) override { + const StreamInfo::StreamInfo&, absl::optional) override { outer_encoder_ = &encoder; host_ = host; pool_ready_.ready(); diff --git a/test/common/http/mixed_conn_pool_test.cc b/test/common/http/mixed_conn_pool_test.cc index 578070cf9bec..a3ba9b2e7b46 100644 --- a/test/common/http/mixed_conn_pool_test.cc +++ b/test/common/http/mixed_conn_pool_test.cc @@ -28,7 +28,6 @@ class ConnPoolImplForTest : public HttpConnPoolImplBase { random, state, {Http::Protocol::Http2, Http::Protocol::Http11}) {} Envoy::ConnectionPool::ActiveClientPtr instantiateActiveClient() override { return nullptr; } - Http::Protocol protocol() const override { return Http::Protocol::Http2; } CodecClientPtr createCodecClient(Upstream::Host::CreateConnectionData&) override { return nullptr; } diff --git a/test/common/router/router_test.cc b/test/common/router/router_test.cc index 20ada9e6c527..4596d81a8f29 100644 --- a/test/common/router/router_test.cc +++ b/test/common/router/router_test.cc @@ -251,7 +251,8 @@ class RouterTestBase : public testing::Test { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -287,7 +288,8 @@ class RouterTestBase : public testing::Test { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder_ = &decoder; EXPECT_CALL(callbacks_.dispatcher_, setTrackedObject(_)).Times(testing::AtLeast(2)); - callbacks.onPoolReady(original_encoder_, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(original_encoder_, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); HttpTestUtility::addDefaultHeaders(default_request_headers_); @@ -470,7 +472,8 @@ TEST_F(RouterTest, MissingRequiredHeaders) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -670,7 +673,8 @@ TEST_F(RouterTest, AddCookie) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -722,7 +726,8 @@ TEST_F(RouterTest, AddCookieNoDuplicate) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -773,7 +778,8 @@ TEST_F(RouterTest, AddMultipleCookies) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -963,7 +969,8 @@ TEST_F(RouterTest, ResponseCodeDetailsSetByUpstream) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -988,7 +995,8 @@ TEST_F(RouterTest, EnvoyUpstreamServiceTime) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1044,7 +1052,8 @@ TEST_F(RouterTest, EnvoyAttemptCountInRequestUpdatedInRetries) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1074,7 +1083,8 @@ TEST_F(RouterTest, EnvoyAttemptCountInRequestUpdatedInRetries) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -1185,7 +1195,8 @@ TEST_F(RouterTest, EnvoyAttemptCountInResponseWithRetries) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1212,7 +1223,8 @@ TEST_F(RouterTest, EnvoyAttemptCountInResponseWithRetries) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -1255,7 +1267,8 @@ void RouterTestBase::testAppendCluster(absl::optional clu [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1312,7 +1325,8 @@ void RouterTestBase::testAppendUpstreamHost( [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1444,7 +1458,8 @@ TEST_F(RouterTestSuppressEnvoyHeaders, EnvoyUpstreamServiceTime) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1476,7 +1491,8 @@ TEST_F(RouterTest, NoRetriesOverflow) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1503,7 +1519,8 @@ TEST_F(RouterTest, NoRetriesOverflow) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -1530,7 +1547,8 @@ TEST_F(RouterTest, ResetDuringEncodeHeaders) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -1564,7 +1582,8 @@ TEST_F(RouterTest, UpstreamTimeout) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(callbacks_.stream_info_, onUpstreamHostSelected(_)) @@ -1613,7 +1632,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStat) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1656,7 +1676,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStatFailure) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1698,7 +1719,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStatOnlyGlobal) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1738,7 +1760,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStatDuringRetries) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1783,7 +1806,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStatDuringRetries) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1833,7 +1857,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStatDuringGlobalTimeout) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1878,7 +1903,8 @@ TEST_F(RouterTest, TimeoutBudgetHistogramStatDuringGlobalTimeout) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -1928,7 +1954,8 @@ TEST_F(RouterTest, GrpcOkTrailersOnly) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1956,7 +1983,8 @@ TEST_F(RouterTest, GrpcAlreadyExistsTrailersOnly) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -1984,7 +2012,8 @@ TEST_F(RouterTest, GrpcOutlierDetectionUnavailableStatusCode) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2013,7 +2042,8 @@ TEST_F(RouterTest, GrpcInternalTrailersOnly) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2042,7 +2072,8 @@ TEST_F(RouterTest, GrpcDataEndStream) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2074,7 +2105,8 @@ TEST_F(RouterTest, GrpcReset) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2107,7 +2139,8 @@ TEST_F(RouterTest, GrpcOk) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2142,7 +2175,8 @@ TEST_F(RouterTest, GrpcInternal) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2173,7 +2207,8 @@ TEST_F(RouterTest, UpstreamTimeoutWithAltResponse) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(callbacks_.stream_info_, onUpstreamHostSelected(_)) @@ -2219,7 +2254,8 @@ TEST_F(RouterTest, UpstreamPerTryTimeout) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(callbacks_.stream_info_, onUpstreamHostSelected(_)) @@ -2233,7 +2269,7 @@ TEST_F(RouterTest, UpstreamPerTryTimeout) { router_.decodeHeaders(headers, false); // We verify that both timeouts are started after decodeData(_, true) is called. This - // verifies that we are not starting the initial per try timeout on the first onPoolReady. + // verifies that we are not starting the initial per try timeout on the first onPoolReady.FOO expectPerTryTimerCreate(); expectResponseTimerCreate(); @@ -2261,7 +2297,7 @@ TEST_F(RouterTest, UpstreamPerTryTimeout) { EXPECT_TRUE(verifyHostUpstreamStats(0, 1)); } -// Verifies that the per try timeout starts when onPoolReady is called when it occurs +// Verifies that the per try timeout starts when onPoolReady is called when it occursFOO // after the downstream request has been read. TEST_F(RouterTest, UpstreamPerTryTimeoutDelayedPoolReady) { NiceMock encoder; @@ -2286,7 +2322,7 @@ TEST_F(RouterTest, UpstreamPerTryTimeoutDelayedPoolReady) { Buffer::OwnedImpl data; router_.decodeData(data, true); - // Per try timeout starts when onPoolReady is called. + // Per try timeout starts when onPoolReady is called.FOO expectPerTryTimerCreate(); EXPECT_CALL(callbacks_.stream_info_, onUpstreamHostSelected(_)) .WillOnce(Invoke([&](const Upstream::HostDescriptionConstSharedPtr host) -> void { @@ -2295,7 +2331,8 @@ TEST_F(RouterTest, UpstreamPerTryTimeoutDelayedPoolReady) { EXPECT_EQ(0U, callbacks_.route_->route_entry_.virtual_cluster_.stats().upstream_rq_total_.value()); - pool_callbacks->onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + pool_callbacks->onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); EXPECT_EQ(1U, callbacks_.route_->route_entry_.virtual_cluster_.stats().upstream_rq_total_.value()); @@ -2353,7 +2390,8 @@ TEST_F(RouterTest, UpstreamPerTryTimeoutExcludesNewStream) { EXPECT_EQ(0U, callbacks_.route_->route_entry_.virtual_cluster_.stats().upstream_rq_total_.value()); // The per try timeout timer should not be started yet. - pool_callbacks->onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + pool_callbacks->onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); EXPECT_EQ(1U, callbacks_.route_->route_entry_.virtual_cluster_.stats().upstream_rq_total_.value()); @@ -2391,7 +2429,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutFirstRequestSucceeds) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -2422,7 +2461,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutFirstRequestSucceeds) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -2471,7 +2511,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutResetsOnBadHeaders) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -2502,7 +2543,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutResetsOnBadHeaders) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -2557,7 +2599,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutThirdRequestSucceeds) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2592,7 +2635,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutThirdRequestSucceeds) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -2615,7 +2659,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutThirdRequestSucceeds) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder3 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder3, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder3, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -2661,7 +2706,8 @@ TEST_F(RouterTest, RetryOnlyOnceForSameUpstreamRequest) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -2691,7 +2737,8 @@ TEST_F(RouterTest, RetryOnlyOnceForSameUpstreamRequest) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -2728,7 +2775,8 @@ TEST_F(RouterTest, BadHeadersDroppedIfPreviousRetryScheduled) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -2771,7 +2819,8 @@ TEST_F(RouterTest, BadHeadersDroppedIfPreviousRetryScheduled) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -2798,7 +2847,8 @@ TEST_F(RouterTest, RetryRequestBeforeBody) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2817,7 +2867,8 @@ TEST_F(RouterTest, RetryRequestBeforeBody) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(encoder2, encodeHeaders(HeaderHasValueRef("myheader", "present"), false)); @@ -2858,7 +2909,8 @@ TEST_F(RouterTest, RetryRequestDuringBody) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2881,7 +2933,8 @@ TEST_F(RouterTest, RetryRequestDuringBody) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -2926,7 +2979,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyDataBetweenAttemptsNotEndStream) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -2953,7 +3007,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyDataBetweenAttemptsNotEndStream) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -2997,7 +3052,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyCompleteBetweenAttempts) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3024,7 +3080,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyCompleteBetweenAttempts) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3062,7 +3119,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyTrailerBetweenAttempts) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3088,7 +3146,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyTrailerBetweenAttempts) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3128,7 +3187,8 @@ TEST_F(RouterTest, RetryRequestDuringBodyBufferLimitExceeded) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3169,7 +3229,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutGlobalTimeout) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -3201,7 +3262,8 @@ TEST_F(RouterTest, HedgedPerTryTimeoutGlobalTimeout) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -3241,7 +3303,8 @@ TEST_F(RouterTest, HedgingRetriesExhaustedBadResponse) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -3273,7 +3336,8 @@ TEST_F(RouterTest, HedgingRetriesExhaustedBadResponse) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -3329,7 +3393,8 @@ TEST_F(RouterTest, HedgingRetriesProceedAfterReset) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder1 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); // First is reset @@ -3365,7 +3430,8 @@ TEST_F(RouterTest, HedgingRetriesProceedAfterReset) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder2 = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -3415,7 +3481,8 @@ TEST_F(RouterTest, HedgingRetryImmediatelyReset) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, @@ -3488,7 +3555,8 @@ TEST_F(RouterTest, RetryNoneHealthy) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3529,7 +3597,8 @@ TEST_F(RouterTest, RetryUpstreamReset) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -3559,7 +3628,8 @@ TEST_F(RouterTest, RetryUpstreamReset) { EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, putResult(Upstream::Outlier::Result::LocalOriginConnectSuccess, absl::optional(absl::nullopt))); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -3584,7 +3654,8 @@ TEST_F(RouterTest, NoRetryWithBodyLimit) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -3618,7 +3689,8 @@ TEST_F(RouterTest, RetryUpstreamPerTryTimeout) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -3649,7 +3721,8 @@ TEST_F(RouterTest, RetryUpstreamPerTryTimeout) { EXPECT_CALL(cm_.conn_pool_.host_->outlier_detector_, putResult(Upstream::Outlier::Result::LocalOriginConnectSuccess, absl::optional(absl::nullopt))); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -3701,7 +3774,8 @@ TEST_F(RouterTest, RetryUpstreamConnectionFailure) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -3725,7 +3799,8 @@ TEST_F(RouterTest, DontResetStartedResponseOnUpstreamPerTryTimeout) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -3765,7 +3840,8 @@ TEST_F(RouterTest, RetryUpstreamResetResponseStarted) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -3808,7 +3884,8 @@ TEST_F(RouterTest, Coalesce100ContinueHeaders) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -3858,7 +3935,8 @@ TEST_F(RouterTest, RetryUpstreamReset100ContinueResponseStarted) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -3895,7 +3973,8 @@ TEST_F(RouterTest, RetryUpstream5xx) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -3922,7 +4001,8 @@ TEST_F(RouterTest, RetryUpstream5xx) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -3947,7 +4027,8 @@ TEST_F(RouterTest, RetryTimeoutDuringRetryDelay) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -3988,7 +4069,8 @@ TEST_F(RouterTest, MaxStreamDurationValidlyConfiguredWithoutRetryPolicy) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectMaxStreamDurationTimerCreate(); @@ -4011,7 +4093,8 @@ TEST_F(RouterTest, MaxStreamDurationDisabledIfSetToZero) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -4035,7 +4118,8 @@ TEST_F(RouterTest, MaxStreamDurationCallbackNotCalled) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectMaxStreamDurationTimerCreate(); @@ -4057,7 +4141,8 @@ TEST_F(RouterTest, MaxStreamDurationWhenDownstreamAlreadyStartedWithoutRetryPoli [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectMaxStreamDurationTimerCreate(); @@ -4084,7 +4169,8 @@ TEST_F(RouterTest, MaxStreamDurationWithRetryPolicy) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectMaxStreamDurationTimerCreate(); @@ -4105,7 +4191,8 @@ TEST_F(RouterTest, MaxStreamDurationWithRetryPolicy) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectMaxStreamDurationTimerCreate(); @@ -4126,7 +4213,8 @@ TEST_F(RouterTest, RetryTimeoutDuringRetryDelayWithUpstreamRequestNoHost) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4180,7 +4268,8 @@ TEST_F(RouterTest, RetryTimeoutDuringRetryDelayWithUpstreamRequestNoHostAltRespo [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4233,7 +4322,8 @@ TEST_F(RouterTest, RetryUpstream5xxNotComplete) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4268,7 +4358,8 @@ TEST_F(RouterTest, RetryUpstream5xxNotComplete) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); ON_CALL(callbacks_, decodingBuffer()).WillByDefault(Return(body_data.get())); @@ -4312,7 +4403,8 @@ TEST_F(RouterTest, RetryUpstreamGrpcCancelled) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4342,7 +4434,8 @@ TEST_F(RouterTest, RetryUpstreamGrpcCancelled) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); router_.retry_state_->callback_(); @@ -4370,7 +4463,8 @@ TEST_F(RouterTest, RetryRespsectsMaxHostSelectionCount) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4409,7 +4503,8 @@ TEST_F(RouterTest, RetryRespsectsMaxHostSelectionCount) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); ON_CALL(callbacks_, decodingBuffer()).WillByDefault(Return(body_data.get())); @@ -4445,7 +4540,8 @@ TEST_F(RouterTest, RetryRespectsRetryHostPredicate) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4484,7 +4580,8 @@ TEST_F(RouterTest, RetryRespectsRetryHostPredicate) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); ON_CALL(callbacks_, decodingBuffer()).WillByDefault(Return(body_data.get())); @@ -4740,7 +4837,8 @@ TEST_F(RouterTest, Shadow) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -4799,7 +4897,8 @@ TEST_F(RouterTest, AltStatName) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5012,7 +5111,8 @@ TEST_F(RouterTest, PropagatesUpstreamFilterState) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5043,7 +5143,8 @@ TEST_F(RouterTest, UpstreamSSLConnection) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5072,7 +5173,8 @@ TEST_F(RouterTest, UpstreamTimingSingleRequest) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -5133,7 +5235,8 @@ TEST_F(RouterTest, UpstreamTimingRetry) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -5161,7 +5264,8 @@ TEST_F(RouterTest, UpstreamTimingRetry) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5219,7 +5323,8 @@ TEST_F(RouterTest, UpstreamTimingTimeout) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5783,7 +5888,8 @@ TEST_F(RouterTest, CanaryStatusTrue) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5819,7 +5925,8 @@ TEST_F(RouterTest, CanaryStatusFalse) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5861,7 +5968,8 @@ TEST_F(RouterTest, AutoHostRewriteEnabled) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](Http::StreamDecoder&, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5899,7 +6007,8 @@ TEST_F(RouterTest, AutoHostRewriteDisabled) { EXPECT_CALL(cm_.conn_pool_, newStream(_, _)) .WillOnce(Invoke([&](Http::StreamDecoder&, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -5986,7 +6095,8 @@ TEST_F(RouterTest, ConnectPauseAndResume) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -6026,7 +6136,8 @@ TEST_F(RouterTest, ConnectPauseNoResume) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -6089,7 +6200,8 @@ class WatermarkTest : public RouterTest { response_decoder_ = &decoder; pool_callbacks_ = &callbacks; if (pool_ready) { - callbacks.onPoolReady(encoder_, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder_, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); } return nullptr; })); @@ -6185,7 +6297,8 @@ TEST_F(WatermarkTest, FilterWatermarks) { .value()); EXPECT_CALL(encoder_, encodeData(_, true)) .WillOnce(Invoke([&](Buffer::Instance& data, bool) -> void { data.drain(data.length()); })); - pool_callbacks_->onPoolReady(encoder_, cm_.conn_pool_.host_, upstream_stream_info_); + pool_callbacks_->onPoolReady(encoder_, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); EXPECT_EQ(1U, cm_.thread_local_cluster_.cluster_.info_->stats_store_ .counter("upstream_flow_control_drained_total") .value()); @@ -6227,7 +6340,8 @@ TEST_F(WatermarkTest, RetryRequestNotComplete) { [&](Http::ResponseDecoder& decoder, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); EXPECT_CALL(callbacks_.stream_info_, @@ -6277,7 +6391,8 @@ TEST_F(RouterTestChildSpan, BasicFlow) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; EXPECT_CALL(*child_span, injectContext(_)); - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -6320,7 +6435,8 @@ TEST_F(RouterTestChildSpan, ResetFlow) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; EXPECT_CALL(*child_span, injectContext(_)); - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -6367,7 +6483,8 @@ TEST_F(RouterTestChildSpan, CancelFlow) { .WillOnce(Invoke([&](Http::StreamDecoder&, Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { EXPECT_CALL(*child_span, injectContext(_)); - callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); @@ -6409,7 +6526,8 @@ TEST_F(RouterTestChildSpan, ResetRetryFlow) { Http::ConnectionPool::Callbacks& callbacks) -> Http::ConnectionPool::Cancellable* { response_decoder = &decoder; EXPECT_CALL(*child_span_1, injectContext(_)); - callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder1, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -6450,7 +6568,8 @@ TEST_F(RouterTestChildSpan, ResetRetryFlow) { response_decoder = &decoder; EXPECT_CALL(*child_span_2, injectContext(_)); EXPECT_CALL(*router_.retry_state_, onHostAttempted(_)); - callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_); + callbacks.onPoolReady(encoder2, cm_.conn_pool_.host_, upstream_stream_info_, + Http::Protocol::Http10); return nullptr; })); diff --git a/test/common/router/router_upstream_log_test.cc b/test/common/router/router_upstream_log_test.cc index 768d2f8eaad7..632eca512b22 100644 --- a/test/common/router/router_upstream_log_test.cc +++ b/test/common/router/router_upstream_log_test.cc @@ -138,7 +138,7 @@ class RouterUpstreamLogTest : public testing::Test { EXPECT_CALL(encoder.stream_, connectionLocalAddress()) .WillRepeatedly(ReturnRef(upstream_local_address1_)); callbacks.onPoolReady(encoder, context_.cluster_manager_.conn_pool_.host_, - stream_info_); + stream_info_, Http::Protocol::Http10); return nullptr; })); expectResponseTimerCreate(); @@ -176,7 +176,7 @@ class RouterUpstreamLogTest : public testing::Test { EXPECT_CALL(encoder1.stream_, connectionLocalAddress()) .WillRepeatedly(ReturnRef(upstream_local_address1_)); callbacks.onPoolReady(encoder1, context_.cluster_manager_.conn_pool_.host_, - stream_info_); + stream_info_, Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); @@ -205,7 +205,7 @@ class RouterUpstreamLogTest : public testing::Test { EXPECT_CALL(encoder2.stream_, connectionLocalAddress()) .WillRepeatedly(ReturnRef(upstream_local_address2_)); callbacks.onPoolReady(encoder2, context_.cluster_manager_.conn_pool_.host_, - stream_info_); + stream_info_, Http::Protocol::Http10); return nullptr; })); expectPerTryTimerCreate(); diff --git a/test/extensions/upstreams/http/tcp/upstream_request_test.cc b/test/extensions/upstreams/http/tcp/upstream_request_test.cc index d835151eab82..ea7b55f8b2b1 100644 --- a/test/extensions/upstreams/http/tcp/upstream_request_test.cc +++ b/test/extensions/upstreams/http/tcp/upstream_request_test.cc @@ -57,7 +57,7 @@ TEST_F(TcpConnPoolTest, Basic) { conn_pool_->newStream(&mock_generic_callbacks_); EXPECT_CALL(mock_generic_callbacks_, upstreamToDownstream()); - EXPECT_CALL(mock_generic_callbacks_, onPoolReady(_, _, _, _)); + EXPECT_CALL(mock_generic_callbacks_, onPoolReady(_, _, _, _, _)); auto data = std::make_unique>(); EXPECT_CALL(*data, connection()).Times(AnyNumber()).WillRepeatedly(ReturnRef(connection)); conn_pool_->onPoolReady(std::move(data), host_); diff --git a/test/integration/upstreams/per_host_upstream_config.h b/test/integration/upstreams/per_host_upstream_config.h index 4fc498bda316..06095235a4a5 100644 --- a/test/integration/upstreams/per_host_upstream_config.h +++ b/test/integration/upstreams/per_host_upstream_config.h @@ -77,13 +77,13 @@ class PerHostHttpConnPool : public Extensions::Upstreams::Http::Http::HttpConnPo : HttpConnPool(cm, is_connect, route_entry, downstream_protocol, ctx) {} void onPoolReady(Envoy::Http::RequestEncoder& callbacks_encoder, - Upstream::HostDescriptionConstSharedPtr host, - const StreamInfo::StreamInfo& info) override { + Upstream::HostDescriptionConstSharedPtr host, const StreamInfo::StreamInfo& info, + absl::optional protocol) override { conn_pool_stream_handle_ = nullptr; auto upstream = std::make_unique(callbacks_->upstreamToDownstream(), &callbacks_encoder, host); callbacks_->onPoolReady(std::move(upstream), host, - callbacks_encoder.getStream().connectionLocalAddress(), info); + callbacks_encoder.getStream().connectionLocalAddress(), info, protocol); } }; @@ -113,4 +113,4 @@ class PerHostGenericConnPoolFactory : public Router::GenericConnPoolFactory { } }; -} // namespace Envoy \ No newline at end of file +} // namespace Envoy diff --git a/test/mocks/config/mocks.h b/test/mocks/config/mocks.h index 943630ef4f2f..8c2cc7ac2177 100644 --- a/test/mocks/config/mocks.h +++ b/test/mocks/config/mocks.h @@ -78,7 +78,7 @@ class MockSubscriptionFactory : public SubscriptionFactory { Stats::Scope& scope, SubscriptionCallbacks& callbacks, OpaqueResourceDecoder& resource_decoder)); MOCK_METHOD(SubscriptionPtr, collectionSubscriptionFromUrl, - (const udpa::core::v1::ResourceLocator& collection_locator, + (const xds::core::v3::ResourceLocator& collection_locator, const envoy::config::core::v3::ConfigSource& config, absl::string_view type_url, Stats::Scope& scope, SubscriptionCallbacks& callbacks, OpaqueResourceDecoder& resource_decoder)); diff --git a/test/mocks/router/mocks.h b/test/mocks/router/mocks.h index b015647a791d..02be9a0824c1 100644 --- a/test/mocks/router/mocks.h +++ b/test/mocks/router/mocks.h @@ -569,7 +569,7 @@ class MockGenericConnectionPoolCallbacks : public GenericConnectionPoolCallbacks (std::unique_ptr && upstream, Upstream::HostDescriptionConstSharedPtr host, const Network::Address::InstanceConstSharedPtr& upstream_local_address, - const StreamInfo::StreamInfo& info)); + const StreamInfo::StreamInfo& info, absl::optional protocol)); MOCK_METHOD(UpstreamToDownstream&, upstreamToDownstream, ()); NiceMock upstream_to_downstream_; diff --git a/test/mocks/server/listener_component_factory.h b/test/mocks/server/listener_component_factory.h index 23953b1cec44..4f8b1213840b 100644 --- a/test/mocks/server/listener_component_factory.h +++ b/test/mocks/server/listener_component_factory.h @@ -20,13 +20,13 @@ class MockListenerComponentFactory : public ListenerComponentFactory { return DrainManagerPtr{createDrainManager_(drain_type)}; } LdsApiPtr createLdsApi(const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator* lds_resources_locator) override { + const xds::core::v3::ResourceLocator* lds_resources_locator) override { return LdsApiPtr{createLdsApi_(lds_config, lds_resources_locator)}; } MOCK_METHOD(LdsApi*, createLdsApi_, (const envoy::config::core::v3::ConfigSource&, - const udpa::core::v1::ResourceLocator*)); + const xds::core::v3::ResourceLocator*)); MOCK_METHOD(std::vector, createNetworkFilterFactoryList, (const Protobuf::RepeatedPtrField& filters, Configuration::FilterChainFactoryContext& filter_chain_factory_context)); diff --git a/test/mocks/server/listener_manager.h b/test/mocks/server/listener_manager.h index 2f2baf88f71d..582be9ac9bac 100644 --- a/test/mocks/server/listener_manager.h +++ b/test/mocks/server/listener_manager.h @@ -16,7 +16,7 @@ class MockListenerManager : public ListenerManager { bool modifiable)); MOCK_METHOD(void, createLdsApi, (const envoy::config::core::v3::ConfigSource& lds_config, - const udpa::core::v1::ResourceLocator*)); + const xds::core::v3::ResourceLocator*)); MOCK_METHOD(std::vector>, listeners, (ListenerState state)); MOCK_METHOD(uint64_t, numConnections, (), (const)); diff --git a/tools/proto_format/proto_sync.py b/tools/proto_format/proto_sync.py index 47d95871833d..f6fc70a13a66 100755 --- a/tools/proto_format/proto_sync.py +++ b/tools/proto_format/proto_sync.py @@ -204,8 +204,8 @@ def GetImportDeps(proto_path): imports.append('@com_github_cncf_udpa//udpa/annotations:pkg') continue # Special case handling for UDPA core. - if import_path.startswith('udpa/core/v1/'): - imports.append('@com_github_cncf_udpa//udpa/core/v1:pkg') + if import_path.startswith('xds/core/v3/'): + imports.append('@com_github_cncf_udpa//xds/core/v3:pkg') continue # Explicit remapping for external deps, compute paths for envoy/*. if import_path in external_proto_deps.EXTERNAL_PROTO_IMPORT_BAZEL_DEP_MAP: diff --git a/tools/spelling/spelling_dictionary.txt b/tools/spelling/spelling_dictionary.txt index 7911b3134fd7..69949cbfb741 100644 --- a/tools/spelling/spelling_dictionary.txt +++ b/tools/spelling/spelling_dictionary.txt @@ -1218,6 +1218,7 @@ workspace writev xDS xDSes +xdstp xeon xform xhtml