-
Notifications
You must be signed in to change notification settings - Fork 5.5k
config: v2 non-pubsub transport API fatal-by-default. #14389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |
| #include "common/grpc/common.h" | ||
| #include "common/protobuf/protobuf.h" | ||
| #include "common/protobuf/utility.h" | ||
| #include "common/runtime/runtime_features.h" | ||
| #include "common/singleton/const_singleton.h" | ||
|
|
||
| #include "udpa/type/v1/typed_struct.pb.h" | ||
|
|
@@ -182,6 +183,34 @@ class Utility { | |
| const Upstream::ClusterManager::ClusterSet& primary_clusters, | ||
| const envoy::config::core::v3::ApiConfigSource& api_config_source); | ||
|
|
||
| /** | ||
| * Access transport_api_version field in ApiConfigSource, while validating version | ||
| * compatibility. | ||
| * @param api_config_source the config source to extract transport API version from. | ||
| * @return envoy::config::core::v3::ApiVersion transport API version | ||
| * @throws DeprecateDMajorVersion when the transport version is disabled. | ||
| */ | ||
| template <class Proto> | ||
| static envoy::config::core::v3::ApiVersion | ||
| getAndCheckTransportVersion(const Proto& api_config_source) { | ||
| const auto transport_api_version = api_config_source.transport_api_version(); | ||
| if (transport_api_version == envoy::config::core::v3::ApiVersion::AUTO || | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if people will argue that "AUTO" should automatically use the currently "stable" version. But I agree that being explicit is great.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we agreed to deprecate |
||
| transport_api_version == envoy::config::core::v3::ApiVersion::V2) { | ||
| Runtime::LoaderSingleton::getExisting()->countDeprecatedFeatureUse(); | ||
| const std::string& warning = fmt::format( | ||
| "V2 (and AUTO) xDS transport protocol versions are deprecated in {}. " | ||
| "The v2 xDS major version is deprecated and disabled by default. Support for v2 will be " | ||
| "removed from Envoy at the start of Q1 2021. You may make use of v2 in Q4 2020 by " | ||
| "following the advice in https://www.envoyproxy.io/docs/envoy/latest/faq/api/transition.", | ||
| api_config_source.DebugString()); | ||
| ENVOY_LOG_MISC(warn, warning); | ||
| if (!Runtime::runtimeFeatureEnabled("envoy.reloadable_features.enable_deprecated_v2_api")) { | ||
| throw DeprecatedMajorVersionException(warning); | ||
| } | ||
| } | ||
| return transport_api_version; | ||
| } | ||
|
|
||
| /** | ||
| * Parses RateLimit configuration from envoy::config::core::v3::ApiConfigSource to | ||
| * RateLimitSettings. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.