Skip to content

Commit

Permalink
config/router/tcp_proxy/options: v2 API, boosting and --bootstrap-ver…
Browse files Browse the repository at this point in the history
…sion CLI removal. (envoyproxy#17724)

* config/router/tcp_proxy/options: v2 API, boosting and --boostrap-verison CLI removal.

This PR cleans up a bunch of v2 tech debt, including version conversion and API oracle
code:
* Remove all non-trivial field references to hidden_envoy_deprecated_*. These were primarily
  in tcp_proxy and router.
* Remove boosting, hidden type annotation and the API type oracle. We are now only v3 for
  both resource and transport API version.
* Remove --boostrap-version flag (all boostraps already must be v3).

Risk level: High (It's possible there were some runtime guarded or not dependencies on
  boosting).
Testing: Validated test functional coverage when removing hidden_envoy_deprecated_* field tests.
Releasing notes: TODO


Signed-off-by: Harvey Tuch <[email protected]>
  • Loading branch information
htuch authored Aug 24, 2021
1 parent eb9f3a9 commit d142c9d
Show file tree
Hide file tree
Showing 215 changed files with 751 additions and 4,088 deletions.
7 changes: 2 additions & 5 deletions api/envoy/admin/v3/server_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ message CommandLineOptions {
Immediate = 1;
}

reserved 12, 20, 21;
reserved 12, 20, 21, 29;

reserved "max_stats", "max_obj_name_len";
reserved "max_stats", "max_obj_name_len", "bootstrap_version";

// See :option:`--base-id` for details.
uint64 base_id = 1;
Expand Down Expand Up @@ -178,9 +178,6 @@ message CommandLineOptions {
// See :option:`--disable-extensions` for details.
repeated string disabled_extensions = 28;

// See :option:`--bootstrap-version` for details.
uint32 bootstrap_version = 29;

// See :option:`--enable-fine-grain-logging` for details.
bool enable_fine_grain_logging = 34;

Expand Down
7 changes: 2 additions & 5 deletions api/envoy/admin/v4alpha/server_info.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions configs/envoy_double_proxy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ static_resources:
address: front-proxy.yourcompany.net
port_value: 9400
protocol: TCP
# There are so few connections going back
# that we can get some imbalance. Until we come up
# with a better solution just limit the requests
# so we can cycle and get better spread.
max_requests_per_connection: 25000
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
Expand All @@ -161,6 +156,12 @@ static_resources:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}
common_http_protocol_options:
# There are so few connections going back
# that we can get some imbalance. Until we come up
# with a better solution just limit the requests
# so we can cycle and get better spread.
max_requests_per_connection: 25000
- name: lightstep_saas
type: LOGICAL_DNS
lb_policy: ROUND_ROBIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static_resources:
address: 127.0.0.1
port_value: {{ data['kafka_real_port'] }}
admin:
access_log_path: /dev/null
profile_path: /dev/null
address:
socket_address: { address: 127.0.0.1, port_value: {{ data['envoy_monitoring_port'] }} }
5 changes: 2 additions & 3 deletions contrib/rocketmq_proxy/filters/network/test/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ namespace RocketmqProxy {

using RocketmqProxyProto = envoy::extensions::filters::network::rocketmq_proxy::v3::RocketmqProxy;

RocketmqProxyProto parseRocketmqProxyFromV3Yaml(const std::string& yaml,
bool avoid_boosting = true) {
RocketmqProxyProto parseRocketmqProxyFromV3Yaml(const std::string& yaml) {
RocketmqProxyProto rocketmq_proxy;
TestUtility::loadFromYaml(yaml, rocketmq_proxy, false, avoid_boosting);
TestUtility::loadFromYaml(yaml, rocketmq_proxy);
return rocketmq_proxy;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: {address: 0.0.0.0, port_value: 9901}

Expand Down
7 changes: 0 additions & 7 deletions docs/root/operations/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ following are the command line options that Envoy supports.
./envoy -c bootstrap.yaml --config-yaml "node: {id: 'node1'}"
.. option:: --bootstrap-version <integer>

*(optional)* The API version to load the bootstrap as. The value should be a single integer, e.g.
to parse the bootstrap configuration as V3, specify ``--bootstrap-version 3``. If unset, Envoy will
attempt to load the bootstrap as the previous API version and upgrade it to the latest. If that fails,
Envoy will attempt to load the configuration as the latest version.

.. option:: --mode <string>

*(optional)* One of the operating modes for Envoy:
Expand Down
2 changes: 2 additions & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Incompatible Behavior Changes
-----------------------------
*Changes that are expected to cause an incompatibility if applicable; deployment changes are likely required*

* config: the ``--bootstrap-version`` CLI flag has been removed, Envoy has only been able to accept v3
bootstrap configurations since 1.18.0.
* contrib: the :ref:`squash filter <config_http_filters_squash>` has been moved to
:ref:`contrib images <install_contrib>`.
* contrib: the :ref:`kafka broker filter <config_network_filters_kafka_broker>` has been moved to
Expand Down
2 changes: 1 addition & 1 deletion docs/root/version_history/v1.17.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Incompatible Behavior Changes
-----------------------------
*Changes that are expected to cause an incompatibility if applicable; deployment changes are likely required*

* config: v2 is now fatal-by-default. This may be overridden by setting :option:`--bootstrap-version` 2 on the CLI for a v2 bootstrap file and also enabling the runtime ``envoy.reloadable_features.enable_deprecated_v2_api`` feature.
* config: v2 is now fatal-by-default. This may be overridden by setting ``--bootstrap-version 2`` on the CLI for a v2 bootstrap file and also enabling the runtime ``envoy.reloadable_features.enable_deprecated_v2_api`` feature.

Minor Behavior Changes
----------------------
Expand Down
1 change: 0 additions & 1 deletion envoy/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ envoy_cc_library(
hdrs = ["subscription.h"],
deps = [
"//envoy/stats:stats_macros",
"//source/common/config:api_type_oracle_lib",
"//source/common/protobuf",
"@envoy_api//envoy/service/discovery/v3:pkg_cc_proto",
],
Expand Down
1 change: 0 additions & 1 deletion envoy/registry/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ envoy_cc_library(
hdrs = ["registry.h"],
deps = [
"//source/common/common:assert_lib",
"//source/common/config:api_type_oracle_lib",
"//source/common/protobuf:utility_lib",
"//source/extensions/common:utility_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
Expand Down
30 changes: 10 additions & 20 deletions envoy/registry/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "source/common/common/fmt.h"
#include "source/common/common/logger.h"
#include "source/common/common/utility.h"
#include "source/common/config/api_type_oracle.h"
#include "source/common/protobuf/utility.h"
#include "source/extensions/common/utility.h"

Expand Down Expand Up @@ -356,25 +355,16 @@ template <class Base> class FactoryRegistry : public Logger::Loggable<Logger::Id
continue;
}

// Register config types in the mapping and traverse the deprecated message type chain.
while (true) {
auto it = mapping->find(config_type);
if (it != mapping->end() && it->second != factory) {
// Mark double-registered types with a nullptr.
// See issue https://github.com/envoyproxy/envoy/issues/9643.
ENVOY_LOG(warn, "Double registration for type: '{}' by '{}' and '{}'", config_type,
factory->name(), it->second ? it->second->name() : "");
it->second = nullptr;
} else {
mapping->emplace(std::make_pair(config_type, factory));
}

const Protobuf::Descriptor* previous =
Config::ApiTypeOracle::getEarlierVersionDescriptor(config_type);
if (previous == nullptr) {
break;
}
config_type = previous->full_name();
// Register config types in the mapping.
auto it = mapping->find(config_type);
if (it != mapping->end() && it->second != factory) {
// Mark double-registered types with a nullptr.
// See issue https://github.com/envoyproxy/envoy/issues/9643.
ENVOY_LOG(warn, "Double registration for type: '{}' by '{}' and '{}'", config_type,
factory->name(), it->second ? it->second->name() : "");
it->second = nullptr;
} else {
mapping->emplace(std::make_pair(config_type, factory));
}
}

Expand Down
5 changes: 0 additions & 5 deletions envoy/server/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ class Options {
*/
virtual const envoy::config::bootstrap::v3::Bootstrap& configProto() const PURE;

/**
* @return const absl::optional<uint32_t>& the bootstrap version to use, if specified.
*/
virtual const absl::optional<uint32_t>& bootstrapVersion() const PURE;

/**
* @return bool allow unknown fields in the static configuration?
*/
Expand Down
6 changes: 5 additions & 1 deletion examples/grpc-bridge/client/envoy-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ static_resources:
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
http_protocol_options: {}
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http_protocol_options: {}
load_assignment:
cluster_name: backend-proxy
endpoints:
Expand Down
1 change: 0 additions & 1 deletion examples/tls-inspector/envoy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
Expand Down
1 change: 0 additions & 1 deletion examples/udp/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static_resources:
port_value: 5005

admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
Expand Down
7 changes: 3 additions & 4 deletions generated_api_shadow/envoy/admin/v3/server_info.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions generated_api_shadow/envoy/admin/v4alpha/server_info.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 1 addition & 33 deletions source/common/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_library(
name = "api_type_oracle_lib",
srcs = ["api_type_oracle.cc"],
hdrs = ["api_type_oracle.h"],
deps = [
"//source/common/protobuf",
"@com_github_cncf_udpa//udpa/annotations:pkg_cc_proto",
],
)

envoy_cc_library(
name = "api_version_lib",
hdrs = ["api_version.h"],
Expand Down Expand Up @@ -196,7 +186,6 @@ envoy_cc_library(
":delta_subscription_state_lib",
":grpc_stream_lib",
":pausable_ack_queue_lib",
":version_converter_lib",
":watch_map_lib",
":xds_context_params_lib",
":xds_resource_lib",
Expand All @@ -217,7 +206,6 @@ envoy_cc_library(
deps = [
":api_version_lib",
":decoded_resource_lib",
":version_converter_lib",
"//envoy/config:subscription_interface",
"//envoy/event:dispatcher_interface",
"//source/common/buffer:buffer_lib",
Expand Down Expand Up @@ -302,11 +290,7 @@ envoy_cc_library(
envoy_cc_library(
name = "resource_name_lib",
hdrs = ["resource_name.h"],
deps = [
":api_type_oracle_lib",
"//source/common/common:assert_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
],
deps = ["//source/common/common:assert_lib"],
)

envoy_cc_library(
Expand Down Expand Up @@ -383,8 +367,6 @@ envoy_cc_library(
srcs = ["utility.cc"],
hdrs = ["utility.h"],
deps = [
":api_type_oracle_lib",
":version_converter_lib",
"//envoy/config:grpc_mux_interface",
"//envoy/config:subscription_interface",
"//envoy/local_info:local_info_interface",
Expand Down Expand Up @@ -412,20 +394,6 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "version_converter_lib",
srcs = ["version_converter.cc"],
hdrs = ["version_converter.h"],
deps = [
":api_type_oracle_lib",
"//source/common/common:assert_lib",
"//source/common/protobuf",
"//source/common/protobuf:visitor_lib",
"//source/common/protobuf:well_known_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
],
)

envoy_cc_library(
name = "watch_map_lib",
srcs = ["watch_map.cc"],
Expand Down
36 changes: 0 additions & 36 deletions source/common/config/api_type_oracle.cc

This file was deleted.

Loading

0 comments on commit d142c9d

Please sign in to comment.