From d9bb7c9d8c86743b11be37c6ae7f75d187defe71 Mon Sep 17 00:00:00 2001 From: Long Dai Date: Fri, 28 May 2021 06:17:28 +0800 Subject: [PATCH] retry: remove well_known_names (#16696) Signed-off-by: Long Dai --- source/extensions/retry/priority/BUILD | 17 ------------ .../retry/priority/previous_priorities/BUILD | 1 - .../priority/previous_priorities/config.h | 5 +--- .../retry/priority/well_known_names.h | 26 ------------------- .../retry/priority/previous_priorities/BUILD | 1 - .../previous_priorities/config_test.cc | 3 +-- 6 files changed, 2 insertions(+), 51 deletions(-) delete mode 100644 source/extensions/retry/priority/BUILD delete mode 100644 source/extensions/retry/priority/well_known_names.h diff --git a/source/extensions/retry/priority/BUILD b/source/extensions/retry/priority/BUILD deleted file mode 100644 index 22d835b40706..000000000000 --- a/source/extensions/retry/priority/BUILD +++ /dev/null @@ -1,17 +0,0 @@ -load( - "//bazel:envoy_build_system.bzl", - "envoy_cc_library", - "envoy_extension_package", -) - -licenses(["notice"]) # Apache 2 - -envoy_extension_package() - -envoy_cc_library( - name = "well_known_names", - hdrs = ["well_known_names.h"], - deps = [ - "//source/common/singleton:const_singleton", - ], -) diff --git a/source/extensions/retry/priority/previous_priorities/BUILD b/source/extensions/retry/priority/previous_priorities/BUILD index ae736299dc7f..1d2bf066efca 100644 --- a/source/extensions/retry/priority/previous_priorities/BUILD +++ b/source/extensions/retry/priority/previous_priorities/BUILD @@ -30,7 +30,6 @@ envoy_cc_extension( "//include/envoy/registry", "//include/envoy/upstream:retry_interface", "//source/common/protobuf", - "//source/extensions/retry/priority:well_known_names", "@envoy_api//envoy/extensions/retry/priority/previous_priorities/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/retry/priority/previous_priorities/config.h b/source/extensions/retry/priority/previous_priorities/config.h index 3976a94f3297..e6c64b94ebf7 100644 --- a/source/extensions/retry/priority/previous_priorities/config.h +++ b/source/extensions/retry/priority/previous_priorities/config.h @@ -6,7 +6,6 @@ #include "common/protobuf/protobuf.h" #include "extensions/retry/priority/previous_priorities/previous_priorities.h" -#include "extensions/retry/priority/well_known_names.h" namespace Envoy { namespace Extensions { @@ -20,9 +19,7 @@ class PreviousPrioritiesRetryPriorityFactory : public Upstream::RetryPriorityFac ProtobufMessage::ValidationVisitor& validation_visitor, uint32_t max_retries) override; - std::string name() const override { - return RetryPriorityValues::get().PreviousPrioritiesRetryPriority; - } + std::string name() const override { return "envoy.retry_priorities.previous_priorities"; } ProtobufTypes::MessagePtr createEmptyConfigProto() override { return ProtobufTypes::MessagePtr(new envoy::extensions::retry::priority::previous_priorities:: diff --git a/source/extensions/retry/priority/well_known_names.h b/source/extensions/retry/priority/well_known_names.h deleted file mode 100644 index 5e20524e8df6..000000000000 --- a/source/extensions/retry/priority/well_known_names.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include - -#include "common/singleton/const_singleton.h" - -namespace Envoy { -namespace Extensions { -namespace Retry { -namespace Priority { - -/** - * Well-known retry priority load names. - */ -class RetryPriorityNameValues { -public: - // Previous priority retry priority. Excludes previously attempted priorities during retries. - const std::string PreviousPrioritiesRetryPriority = "envoy.retry_priorities.previous_priorities"; -}; - -using RetryPriorityValues = ConstSingleton; - -} // namespace Priority -} // namespace Retry -} // namespace Extensions -} // namespace Envoy diff --git a/test/extensions/retry/priority/previous_priorities/BUILD b/test/extensions/retry/priority/previous_priorities/BUILD index cc5af8f0a7f8..663245db705e 100644 --- a/test/extensions/retry/priority/previous_priorities/BUILD +++ b/test/extensions/retry/priority/previous_priorities/BUILD @@ -17,7 +17,6 @@ envoy_extension_cc_test( extension_name = "envoy.retry_priorities.previous_priorities", deps = [ "//source/common/protobuf:message_validator_lib", - "//source/extensions/retry/priority:well_known_names", "//source/extensions/retry/priority/previous_priorities:config", "//test/mocks/upstream:host_mocks", "//test/mocks/upstream:host_set_mocks", diff --git a/test/extensions/retry/priority/previous_priorities/config_test.cc b/test/extensions/retry/priority/previous_priorities/config_test.cc index 3d46262e926b..2b7e88d8cacd 100644 --- a/test/extensions/retry/priority/previous_priorities/config_test.cc +++ b/test/extensions/retry/priority/previous_priorities/config_test.cc @@ -5,7 +5,6 @@ #include "common/protobuf/message_validator_impl.h" #include "extensions/retry/priority/previous_priorities/config.h" -#include "extensions/retry/priority/well_known_names.h" #include "test/mocks/upstream/host.h" #include "test/mocks/upstream/host_set.h" @@ -28,7 +27,7 @@ class RetryPriorityTest : public testing::Test { void initialize(const Upstream::HealthyLoad& original_healthy_priority_load, const Upstream::DegradedLoad& original_degraded_priority_load) { auto factory = Registry::FactoryRegistry::getFactory( - RetryPriorityValues::get().PreviousPrioritiesRetryPriority); + "envoy.retry_priorities.previous_priorities"); envoy::extensions::retry::priority::previous_priorities::v3::PreviousPrioritiesConfig config; config.set_update_frequency(update_frequency_);