Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ extensions/filters/http/oauth2 @derekargueta @snowp
/*/extensions/filters/http/common @UNOWNED @UNOWNED
/*/extensions/filters/network/common @UNOWNED @UNOWNED
/*/extensions/clusters/original_dst @UNOWNED @UNOWNED

/*/extensions/clusters/logical_dns/ @UNOWNED @UNOWNED
/*/extensions/clusters/common/ @UNOWNED @UNOWNED

# URL Pattern Match and Rewrite Library
/*/extensions/path/uri_template_lib @alyssawilk @yanjunxiang-google
Expand Down
2 changes: 1 addition & 1 deletion changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ behavior_changes:
# *Changes that are expected to cause an incompatibility if applicable; deployment changes are likely required*
- area: build
change: |
moved the original_dst cluster to extensions. If you use this cluster and override extensions_build_config.bzl you will now need to include it explicitly.
moved the original_dst and logical_dns clusters to extensions. If you use either of these cluster and override extensions_build_config.bzl you will now need to include it explicitly.

minor_behavior_changes:
# *Changes that may cause incompatibilities for some users, but should not for most*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ controls the refresh frequency during failures, and, if not configured, the DNS
DNS resolving emits :ref:`cluster statistics <config_cluster_manager_cluster_stats>` fields *update_attempt*, *update_success* and *update_failure*.

.. _arch_overview_service_discovery_types_logical_dns:
.. _extension_envoy.clusters.logical_dns:

Logical DNS
^^^^^^^^^^^
Expand Down
35 changes: 0 additions & 35 deletions source/common/upstream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -330,40 +330,6 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "logical_host_lib",
srcs = ["logical_host.cc"],
hdrs = ["logical_host.h"],
deps = [
":upstream_includes",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto",
],
)

envoy_cc_library(
name = "logical_dns_cluster_lib",
srcs = ["logical_dns_cluster.cc"],
hdrs = ["logical_dns_cluster.h"],
deps = [
":cluster_factory_lib",
":logical_host_lib",
":upstream_includes",
"//envoy/upstream:cluster_factory_interface",
"//source/common/common:dns_utils_lib",
"//source/common/common:empty_string",
"//source/common/config:utility_lib",
"//source/common/network:address_lib",
"//source/common/network:utility_lib",
"//source/common/protobuf",
"//source/common/protobuf:utility_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto",
],
alwayslink = LEGACY_ALWAYSLINK,
)

envoy_cc_library(
name = "outlier_detection_lib",
srcs = ["outlier_detection_impl.cc"],
Expand Down Expand Up @@ -519,7 +485,6 @@ envoy_cc_library(
":eds_lib",
":health_checker_lib",
# TODO(mattklein123): Move the clusters to extensions so they can be compiled out.
":logical_dns_cluster_lib",
":static_cluster_lib",
":strict_dns_cluster_lib",
":upstream_includes",
Expand Down
1 change: 0 additions & 1 deletion source/common/upstream/upstream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include "source/common/upstream/cluster_factory_impl.h"
#include "source/common/upstream/eds.h"
#include "source/common/upstream/health_checker_impl.h"
#include "source/common/upstream/logical_dns_cluster.h"
#include "source/extensions/filters/network/http_connection_manager/config.h"
#include "source/server/transport_socket_config_impl.h"

Expand Down
20 changes: 20 additions & 0 deletions source/extensions/clusters/common/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_extension_package",
)

licenses(["notice"]) # Apache 2

envoy_extension_package()

envoy_cc_library(
name = "logical_host_lib",
srcs = ["logical_host.cc"],
hdrs = ["logical_host.h"],
deps = [
"//source/common/upstream:upstream_includes",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/common/upstream/logical_host.h"
#include "source/extensions/clusters/common/logical_host.h"

namespace Envoy {
namespace Upstream {
Expand Down
2 changes: 1 addition & 1 deletion source/extensions/clusters/dynamic_forward_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ envoy_cc_extension(
deps = [
"//source/common/network:transport_socket_options_lib",
"//source/common/upstream:cluster_factory_lib",
"//source/common/upstream:logical_host_lib",
"//source/extensions/clusters/common:logical_host_lib",
"//source/extensions/common/dynamic_forward_proxy:dns_cache_interface",
"//source/extensions/common/dynamic_forward_proxy:dns_cache_manager_impl",
"//source/extensions/transport_sockets/tls/cert_validator:cert_validator_lib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "envoy/http/conn_pool.h"

#include "source/common/upstream/cluster_factory_impl.h"
#include "source/common/upstream/logical_host.h"
#include "source/extensions/clusters/common/logical_host.h"
#include "source/extensions/common/dynamic_forward_proxy/dns_cache.h"

namespace Envoy {
Expand Down
33 changes: 33 additions & 0 deletions source/extensions/clusters/logical_dns/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_extension",
"envoy_extension_package",
)

licenses(["notice"]) # Apache 2

envoy_extension_package()

envoy_cc_extension(
name = "logical_dns_cluster_lib",
srcs = ["logical_dns_cluster.cc"],
hdrs = ["logical_dns_cluster.h"],
# prevously considered core code.
visibility = ["//visibility:public"],
deps = [
"//envoy/upstream:cluster_factory_interface",
"//source/common/common:dns_utils_lib",
"//source/common/common:empty_string",
"//source/common/config:utility_lib",
"//source/common/network:address_lib",
"//source/common/network:utility_lib",
"//source/common/protobuf",
"//source/common/protobuf:utility_lib",
"//source/common/upstream:cluster_factory_lib",
"//source/common/upstream:upstream_includes",
"//source/extensions/clusters/common:logical_host_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "source/common/upstream/logical_dns_cluster.h"
#include "source/extensions/clusters/logical_dns/logical_dns_cluster.h"

#include <chrono>
#include <list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#include "source/common/common/empty_string.h"
#include "source/common/upstream/cluster_factory_impl.h"
#include "source/common/upstream/logical_host.h"
#include "source/common/upstream/upstream_impl.h"
#include "source/extensions/clusters/common/logical_host.h"

namespace Envoy {
namespace Upstream {
Expand Down
1 change: 1 addition & 0 deletions source/extensions/extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ EXTENSIONS = {
"envoy.clusters.dynamic_forward_proxy": "//source/extensions/clusters/dynamic_forward_proxy:cluster",
"envoy.clusters.redis": "//source/extensions/clusters/redis:redis_cluster",
"envoy.clusters.original_dst": "//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"envoy.clusters.logical_dns": "//source/extensions/clusters/logical_dns:logical_dns_cluster_lib",

#
# Compression
Expand Down
5 changes: 5 additions & 0 deletions source/extensions/extensions_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ envoy.clusters.redis:
- envoy.clusters
security_posture: requires_trusted_downstream_and_upstream
status: stable
envoy.clusters.logical_dns:
categories:
- envoy.clusters
security_posture: robust_to_untrusted_downstream_and_upstream
status: stable
envoy.compression.brotli.compressor:
categories:
- envoy.compression.compressor
Expand Down
28 changes: 1 addition & 27 deletions test/common/upstream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ envoy_cc_test(
":test_cluster_manager",
"//source/common/router:context_lib",
"//source/common/upstream:load_balancer_factory_base_lib",
"//source/extensions/clusters/logical_dns:logical_dns_cluster_lib",
"//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"//source/extensions/network/dns_resolver/cares:config",
"//source/extensions/transport_sockets/tls:config",
Expand Down Expand Up @@ -443,33 +444,6 @@ envoy_cc_test(
],
)

envoy_cc_test(
name = "logical_dns_cluster_test",
srcs = ["logical_dns_cluster_test.cc"],
deps = [
":utility_lib",
"//source/common/event:dispatcher_lib",
"//source/common/network:utility_lib",
"//source/common/upstream:logical_dns_cluster_lib",
"//source/common/upstream:upstream_lib",
"//source/extensions/transport_sockets/raw_buffer:config",
"//source/server:transport_socket_config_lib",
"//test/mocks:common_lib",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/network:network_mocks",
"//test/mocks/protobuf:protobuf_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:admin_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/ssl:ssl_mocks",
"//test/mocks/thread_local:thread_local_mocks",
"//test/mocks/upstream:cluster_manager_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
],
)

envoy_cc_test(
name = "outlier_detection_impl_test",
srcs = ["outlier_detection_impl_test.cc"],
Expand Down
1 change: 1 addition & 0 deletions test/exe/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ envoy_cc_test(
"//source/common/api:api_lib",
"//source/exe:envoy_main_common_with_core_extensions_lib",
"//source/exe:platform_impl_lib",
"//source/extensions/clusters/logical_dns:logical_dns_cluster_lib",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I wonder if this target can be built w/o reliance on source/extensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, there's already a number of registered extensions such as source/extensions/transport_sockets/raw_buffer/config.h that envoy won't build without

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that said this is why we have the visibility rules and an extra presubmit around extensions not generally being visible to core tests. so it's a pretty well cross-checked system :-)

"//test/mocks/runtime:runtime_mocks",
"//test/test_common:contention_lib",
"//test/test_common:environment_lib",
Expand Down
36 changes: 36 additions & 0 deletions test/extensions/clusters/logical_dns/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_test",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
name = "logical_dns_cluster_test",
srcs = ["logical_dns_cluster_test.cc"],
deps = [
"//source/common/event:dispatcher_lib",
"//source/common/network:utility_lib",
"//source/common/upstream:upstream_lib",
"//source/extensions/clusters/logical_dns:logical_dns_cluster_lib",
"//source/extensions/transport_sockets/raw_buffer:config",
"//source/server:transport_socket_config_lib",
"//test/common/upstream:utility_lib",
"//test/mocks:common_lib",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/network:network_mocks",
"//test/mocks/protobuf:protobuf_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:admin_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/ssl:ssl_mocks",
"//test/mocks/thread_local:thread_local_mocks",
"//test/mocks/upstream:cluster_manager_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "source/common/network/utility.h"
#include "source/common/singleton/manager_impl.h"
#include "source/common/upstream/logical_dns_cluster.h"
#include "source/extensions/clusters/logical_dns/logical_dns_cluster.h"
#include "source/server/transport_socket_config_impl.h"

#include "test/common/upstream/utility.h"
Expand Down
1 change: 0 additions & 1 deletion test/extensions/clusters/redis/redis_cluster_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "source/common/network/utility.h"
#include "source/common/singleton/manager_impl.h"
#include "source/common/upstream/logical_dns_cluster.h"
#include "source/extensions/clusters/redis/redis_cluster.h"

#include "test/common/upstream/utility.h"
Expand Down
1 change: 1 addition & 0 deletions test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ envoy_cc_test_library(
":http_protocol_integration_lib",
":socket_interface_swap_lib",
"//source/common/http:header_map_lib",
"//source/extensions/clusters/logical_dns:logical_dns_cluster_lib",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar question to the //test/exe:main_common_test target.
I guess it is ok because these are tests, but wonder if the extension is inherent to the tests functionality or is it testing non-core functionality (and then the test itself may be moved to the be part of the extension's tests)?

"//source/extensions/filters/http/buffer:config",
"//test/common/http/http2:http2_frame",
"//test/integration/filters:add_invalid_data_filter_lib",
Expand Down
1 change: 1 addition & 0 deletions test/server/config_validation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ envoy_cc_test(
],
env = {"EXAMPLE_CONFIGS_TAR_PATH": "envoy/configs/example_configs.tar"},
deps = [
"//source/extensions/clusters/logical_dns:logical_dns_cluster_lib",
"//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"//source/extensions/filters/http/router:config",
"//source/extensions/filters/listener/original_dst:config",
Expand Down
1 change: 1 addition & 0 deletions tools/code_format/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ unsorted_flags:
# PLEASE DO NOT ADD FILES TO THIS LIST WITHOUT SENIOR MAINTAINER APPROVAL
visibility_excludes:
- source/extensions/clusters/original_dst/
- source/extensions/clusters/logical_dns/
- source/extensions/early_data/BUILD
- source/extensions/filters/http/buffer/BUILD
- source/extensions/filters/network/common/BUILD
Expand Down