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
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ extensions/filters/http/oauth2 @derekargueta @snowp
/*/extensions/filters/common @UNOWNED @UNOWNED
/*/extensions/filters/http/common @UNOWNED @UNOWNED
/*/extensions/filters/network/common @UNOWNED @UNOWNED
/*/extensions/clusters/original_dst @UNOWNED @UNOWNED


# URL Pattern Match and Rewrite Library
/*/extensions/path/uri_template_lib @alyssawilk @yanjunxiang-google
Expand Down
1 change: 1 addition & 0 deletions api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ message Cluster {
// Specific configuration for the
// :ref:`Original Destination <arch_overview_load_balancing_types_original_destination>`
// load balancing policy.
// [#extension: envoy.clusters.original_dst]
message OriginalDstLbConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.Cluster.OriginalDstLbConfig";
Expand Down
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ date: Pending

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.

minor_behavior_changes:
# *Changes that may cause incompatibilities for some users, but should not for most*
Expand Down
22 changes: 0 additions & 22 deletions source/common/upstream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -364,27 +364,6 @@ envoy_cc_library(
alwayslink = LEGACY_ALWAYSLINK,
)

envoy_cc_library(
name = "original_dst_cluster_lib",
srcs = ["original_dst_cluster.cc"],
hdrs = ["original_dst_cluster.h"],
deps = [
":cluster_factory_lib",
":upstream_includes",
"//envoy/secret:secret_manager_interface",
"//envoy/upstream:cluster_factory_interface",
"//source/common/common:empty_string",
"//source/common/network:address_lib",
"//source/common/network:filter_state_dst_address_lib",
"//source/common/network:utility_lib",
"//source/common/runtime:runtime_features_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 @@ -541,7 +520,6 @@ envoy_cc_library(
":health_checker_lib",
# TODO(mattklein123): Move the clusters to extensions so they can be compiled out.
":logical_dns_cluster_lib",
":original_dst_cluster_lib",
":static_cluster_lib",
":strict_dns_cluster_lib",
":upstream_includes",
Expand Down
2 changes: 1 addition & 1 deletion source/common/upstream/cluster_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
#include "source/common/runtime/runtime_features.h"
#include "source/common/tcp/conn_pool.h"
#include "source/common/upstream/cds_api_impl.h"
#include "source/common/upstream/cluster_factory_impl.h"
#include "source/common/upstream/load_balancer_impl.h"
#include "source/common/upstream/maglev_lb.h"
#include "source/common/upstream/original_dst_cluster.h"
#include "source/common/upstream/priority_conn_pool_map_impl.h"
#include "source/common/upstream/ring_hash_lb.h"
#include "source/common/upstream/subset_lb.h"
Expand Down
2 changes: 1 addition & 1 deletion source/common/upstream/upstream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
#include "source/common/router/config_utility.h"
#include "source/common/runtime/runtime_features.h"
#include "source/common/runtime/runtime_impl.h"
#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/common/upstream/original_dst_cluster.h"
#include "source/extensions/filters/network/http_connection_manager/config.h"
#include "source/server/transport_socket_config_impl.h"

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

licenses(["notice"]) # Apache 2

envoy_extension_package()

envoy_cc_extension(
name = "original_dst_cluster_lib",
srcs = ["original_dst_cluster.cc"],
hdrs = ["original_dst_cluster.h"],
# prevously considered core code.
visibility = ["//visibility:public"],
deps = [
"//envoy/secret:secret_manager_interface",
"//envoy/upstream:cluster_factory_interface",
"//source/common/common:empty_string",
"//source/common/network:address_lib",
"//source/common/network:filter_state_dst_address_lib",
"//source/common/network:utility_lib",
"//source/common/runtime:runtime_features_lib",
"//source/common/upstream:cluster_factory_lib",
"//source/common/upstream:upstream_includes",
"@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/original_dst_cluster.h"
#include "source/extensions/clusters/original_dst/original_dst_cluster.h"

#include <chrono>
#include <list>
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 @@ -20,6 +20,7 @@ EXTENSIONS = {
"envoy.clusters.aggregate": "//source/extensions/clusters/aggregate:cluster",
"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",

#
# 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 @@ -85,6 +85,11 @@ envoy.clusters.dynamic_forward_proxy:
- envoy.clusters
security_posture: robust_to_untrusted_downstream
status: stable
envoy.clusters.original_dst:
categories:
- envoy.clusters
security_posture: robust_to_untrusted_downstream_and_upstream
status: stable
envoy.clusters.redis:
categories:
- envoy.clusters
Expand Down
27 changes: 1 addition & 26 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/original_dst:original_dst_cluster_lib",
"//source/extensions/network/dns_resolver/cares:config",
"//source/extensions/transport_sockets/tls:config",
"//test/config:v2_link_hacks",
Expand Down Expand Up @@ -469,32 +470,6 @@ envoy_cc_test(
],
)

envoy_cc_test(
name = "original_dst_cluster_test",
srcs = ["original_dst_cluster_test.cc"],
deps = [
":utility_lib",
"//source/common/event:dispatcher_lib",
"//source/common/network:filter_state_dst_address_lib",
"//source/common/network:utility_lib",
"//source/common/upstream:original_dst_cluster_lib",
"//source/common/upstream:upstream_lib",
"//source/extensions/transport_sockets/raw_buffer:config",
"//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/upstream:cluster_manager_mocks",
"//test/test_common:test_runtime_lib",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
],
)

envoy_cc_test(
name = "outlier_detection_impl_test",
srcs = ["outlier_detection_impl_test.cc"],
Expand Down
35 changes: 35 additions & 0 deletions test/extensions/clusters/original_dst/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_test",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
name = "original_dst_cluster_test",
srcs = ["original_dst_cluster_test.cc"],
deps = [
"//source/common/event:dispatcher_lib",
"//source/common/network:filter_state_dst_address_lib",
"//source/common/network:utility_lib",
"//source/common/upstream:upstream_lib",
"//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"//source/extensions/transport_sockets/raw_buffer:config",
"//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/upstream:cluster_manager_mocks",
"//test/test_common:test_runtime_lib",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/cluster/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "source/common/network/filter_state_dst_address.h"
#include "source/common/network/utility.h"
#include "source/common/singleton/manager_impl.h"
#include "source/common/upstream/original_dst_cluster.h"
#include "source/common/upstream/upstream_impl.h"
#include "source/extensions/clusters/original_dst/original_dst_cluster.h"
#include "source/server/transport_socket_config_impl.h"

#include "test/common/upstream/utility.h"
Expand Down
1 change: 1 addition & 0 deletions test/extensions/filters/listener/original_dst/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ envoy_cc_test(
],
deps = [
"//source/common/http:header_map_lib",
"//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"//source/extensions/filters/http/buffer:config",
"//source/extensions/filters/listener/original_dst:config",
"//source/extensions/filters/network/tcp_proxy:config",
Expand Down
1 change: 1 addition & 0 deletions test/extensions/filters/listener/proxy_protocol/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ envoy_extension_cc_test(
"//source/common/buffer:buffer_lib",
"//source/common/http:codec_client_lib",
"//source/extensions/access_loggers/file:config",
"//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"//source/extensions/filters/listener/proxy_protocol:config",
"//source/extensions/filters/network/tcp_proxy:config",
"//test/integration:http_integration_lib",
Expand Down
1 change: 1 addition & 0 deletions test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ envoy_cc_test(
"//envoy/registry",
"//source/common/http:header_map_lib",
"//source/common/http:headers_lib",
"//source/extensions/clusters/original_dst:original_dst_cluster_lib",
"//test/integration/filters:clear_route_cache_filter_lib",
"//test/integration/filters:encoder_decoder_buffer_filter_lib",
"//test/integration/filters:invalid_header_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/original_dst:original_dst_cluster_lib",
"//source/extensions/filters/http/router:config",
"//source/extensions/filters/listener/original_dst:config",
"//source/extensions/filters/network/http_connection_manager: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 @@ -290,6 +290,7 @@ unsorted_flags:
# https://github.com/envoyproxy/envoy/issues/9953
# PLEASE DO NOT ADD FILES TO THIS LIST WITHOUT SENIOR MAINTAINER APPROVAL
visibility_excludes:
- source/extensions/clusters/original_dst/
- source/extensions/early_data/BUILD
- source/extensions/filters/http/buffer/BUILD
- source/extensions/filters/network/common/BUILD
Expand Down