From 9408fb0ba1bed5375802211258acb7ebb0a829aa Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Wed, 24 Jun 2020 19:40:48 -0400 Subject: [PATCH] Update to merged https://github.com/cncf/udpa/pull/29. Signed-off-by: Harvey Tuch --- api/bazel/repository_locations.bzl | 11 +++-------- generated_api_shadow/bazel/repository_locations.bzl | 11 +++-------- source/common/config/udpa_resource.cc | 6 +++--- test/common/config/udpa_resource_test.cc | 4 ++-- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/api/bazel/repository_locations.bzl b/api/bazel/repository_locations.bzl index 4eb163360939..80989a6f4d35 100644 --- a/api/bazel/repository_locations.bzl +++ b/api/bazel/repository_locations.bzl @@ -13,11 +13,8 @@ GOOGLEAPIS_SHA = "a45019af4d3290f02eaeb1ce10990166978c807cb33a9692141a076ba46d14 PROMETHEUS_GIT_SHA = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" # Nov 17, 2017 PROMETHEUS_SHA = "783bdaf8ee0464b35ec0c8704871e1e72afa0005c3f3587f65d9d6694bf3911b" -UDPA_GIT_SHA = "07b17b004e9aadb53ff9bb904fca432c1e6c2f9d" # June 21, 2020 - -# TODO(htuch): DO NOT COMMIT until https://github.com/cncf/udpa/pull/29 merges and this -# change is removed. -UDPA_SHA256 = "0be50f8c9353c96c570339bcfc36ab26b100e8caa1d0eb5385869a8aa89071c7" +UDPA_GIT_SHA = "ca580c4fcf87b178547c2e9e41a2481b0008efe9" # June 24, 2020 +UDPA_SHA256 = "a1dc305cd56f1dd393fec8ec6b19f4f7d76af9740c7746e9377c8dd480f77e70" ZIPKINAPI_RELEASE = "0.2.2" # Aug 23, 2019 ZIPKINAPI_SHA256 = "688c4fe170821dd589f36ec45aaadc03a618a40283bc1f97da8fa11686fc816b" @@ -44,9 +41,7 @@ REPOSITORY_LOCATIONS = dict( com_github_cncf_udpa = dict( sha256 = UDPA_SHA256, strip_prefix = "udpa-" + UDPA_GIT_SHA, - # TODO(htuch): DO NOT COMMIT until https://github.com/cncf/udpa/pull/29 merges and this - # change is removed. - urls = ["https://github.com/htuch/udpa/archive/" + UDPA_GIT_SHA + ".tar.gz"], + urls = ["https://github.com/cncf/udpa/archive/" + UDPA_GIT_SHA + ".tar.gz"], ), prometheus_metrics_model = dict( sha256 = PROMETHEUS_SHA, diff --git a/generated_api_shadow/bazel/repository_locations.bzl b/generated_api_shadow/bazel/repository_locations.bzl index 4eb163360939..80989a6f4d35 100644 --- a/generated_api_shadow/bazel/repository_locations.bzl +++ b/generated_api_shadow/bazel/repository_locations.bzl @@ -13,11 +13,8 @@ GOOGLEAPIS_SHA = "a45019af4d3290f02eaeb1ce10990166978c807cb33a9692141a076ba46d14 PROMETHEUS_GIT_SHA = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c" # Nov 17, 2017 PROMETHEUS_SHA = "783bdaf8ee0464b35ec0c8704871e1e72afa0005c3f3587f65d9d6694bf3911b" -UDPA_GIT_SHA = "07b17b004e9aadb53ff9bb904fca432c1e6c2f9d" # June 21, 2020 - -# TODO(htuch): DO NOT COMMIT until https://github.com/cncf/udpa/pull/29 merges and this -# change is removed. -UDPA_SHA256 = "0be50f8c9353c96c570339bcfc36ab26b100e8caa1d0eb5385869a8aa89071c7" +UDPA_GIT_SHA = "ca580c4fcf87b178547c2e9e41a2481b0008efe9" # June 24, 2020 +UDPA_SHA256 = "a1dc305cd56f1dd393fec8ec6b19f4f7d76af9740c7746e9377c8dd480f77e70" ZIPKINAPI_RELEASE = "0.2.2" # Aug 23, 2019 ZIPKINAPI_SHA256 = "688c4fe170821dd589f36ec45aaadc03a618a40283bc1f97da8fa11686fc816b" @@ -44,9 +41,7 @@ REPOSITORY_LOCATIONS = dict( com_github_cncf_udpa = dict( sha256 = UDPA_SHA256, strip_prefix = "udpa-" + UDPA_GIT_SHA, - # TODO(htuch): DO NOT COMMIT until https://github.com/cncf/udpa/pull/29 merges and this - # change is removed. - urls = ["https://github.com/htuch/udpa/archive/" + UDPA_GIT_SHA + ".tar.gz"], + urls = ["https://github.com/cncf/udpa/archive/" + UDPA_GIT_SHA + ".tar.gz"], ), prometheus_metrics_model = dict( sha256 = PROMETHEUS_SHA, diff --git a/source/common/config/udpa_resource.cc b/source/common/config/udpa_resource.cc index 7ffd31cc3079..53005e73b578 100644 --- a/source/common/config/udpa_resource.cc +++ b/source/common/config/udpa_resource.cc @@ -37,7 +37,7 @@ std::string UdpaResourceName::encodeUri(const udpa::core::v1::ResourceName& reso } const std::string query_params = query_param_components.empty() ? "" : "?" + absl::StrJoin(query_param_components, "&"); - return absl::StrCat("udpa://", authority, "/", resource_name.qualified_type(), + return absl::StrCat("udpa://", authority, "/", resource_name.resource_type(), path.empty() ? "" : "/", path, query_params); } @@ -64,8 +64,8 @@ udpa::core::v1::ResourceName UdpaResourceName::decodeUri(absl::string_view resou // This is guaranteed by Http::Utility::extractHostPathFromUri. ASSERT(absl::StartsWith(path, "/")); const std::vector path_components = absl::StrSplit(path.substr(1), '/'); - decoded_resource_name.set_qualified_type(std::string(path_components[0])); - if (decoded_resource_name.qualified_type().empty()) { + decoded_resource_name.set_resource_type(std::string(path_components[0])); + if (decoded_resource_name.resource_type().empty()) { throw UdpaResourceName::DecodeException( fmt::format("Qualified type missing from {}", resource_uri)); } diff --git a/test/common/config/udpa_resource_test.cc b/test/common/config/udpa_resource_test.cc index 049046ec01e4..d4e18963cf3a 100644 --- a/test/common/config/udpa_resource_test.cc +++ b/test/common/config/udpa_resource_test.cc @@ -44,7 +44,7 @@ TEST(UdpaResourceNameTest, DecodeEncode) { TEST(UdpaResourceNameTest, DecodeSuccess) { const auto resource_name = UdpaResourceName::decodeUri(EscapedUriWithManyQueryParams); EXPECT_EQ("f123%/#?&=o", resource_name.authority()); - EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.qualified_type()); + EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.resource_type()); EXPECT_EQ(3, resource_name.id().size()); EXPECT_EQ("b%/#?&=ar", resource_name.id()[0]); EXPECT_EQ("", resource_name.id()[1]); @@ -60,7 +60,7 @@ TEST(UdpaResourceNameTest, DecodeEmpty) { const auto resource_name = UdpaResourceName::decodeUri("udpa:///envoy.config.listener.v3.Listener"); EXPECT_TRUE(resource_name.authority().empty()); - EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.qualified_type()); + EXPECT_EQ("envoy.config.listener.v3.Listener", resource_name.resource_type()); EXPECT_TRUE(resource_name.id().empty()); EXPECT_TRUE(resource_name.context().params().empty()); }