From e11c00d906343546951b0ebaeb60df0006cff144 Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Sun, 31 Jan 2021 16:26:04 +0000 Subject: [PATCH 1/3] extensions: update straggler v2 extensions to v3. * Add v3 equivalents of v2 configs that were included in v3 due to no transitive deprecation. This increases consistency and reduces user confusion. We will continue to support these straggler v2 configs beyond the v2 turndown due to the late addition of v3 counterparts, special case code is added to utility.cc to handle this. * There were two extensions, //envoy/config/cluster/redis and //envoy/config/retry/previous_priorities, that for some reason were not upgraded to use v3 config. This is now fixed and I've grepped for other v2 in //source, none remain. Risk level: Medium (changes to extension config types and deprecated config handling). Testing: Additional unit test added for utility.cc handling, upgraded configs to v3 for other tests. Fixes #14735 Fixes #12841 Signed-off-by: Harvey Tuch Co-authored-by: Abhay Narayan Katare --- api/BUILD | 7 +- .../v2/omit_canary_hosts.proto | 3 + .../previous_hosts/v2/previous_hosts.proto | 3 + .../previous_priorities_config.proto | 3 + .../health_checkers/redis}/v3/BUILD | 5 +- .../health_checkers/redis/v3/redis.proto | 26 ++++ .../resource_monitors/fixed_heap/v3/BUILD | 12 ++ .../fixed_heap/v3/fixed_heap.proto | 25 ++++ .../injected_resource/v3/BUILD | 12 ++ .../v3/injected_resource.proto | 26 ++++ .../retry/host/omit_canary_hosts/v3/BUILD | 12 ++ .../v3/omit_canary_hosts.proto | 7 +- .../retry/host/previous_hosts}/v3/BUILD | 5 +- .../previous_hosts/v3/previous_hosts.proto | 7 +- api/versioning/BUILD | 7 +- .../config/health_checker/health_checker.rst | 3 +- .../resource_monitor/resource_monitor.rst | 1 + docs/root/api-v3/config/retry/retry.rst | 1 - .../upstream/health_checkers/redis.rst | 2 +- .../upstream/health_checking.rst | 2 +- generated_api_shadow/BUILD | 6 +- .../v2/omit_canary_hosts.proto | 3 + .../previous_hosts/v2/previous_hosts.proto | 3 + .../previous_priorities_config.proto | 3 + .../health_checkers/redis}/v3/BUILD | 5 +- .../health_checkers/redis/v3/redis.proto | 26 ++++ .../resource_monitors/fixed_heap/v3/BUILD | 12 ++ .../fixed_heap/v3/fixed_heap.proto | 25 ++++ .../injected_resource/v3/BUILD | 12 ++ .../v3/injected_resource.proto | 26 ++++ .../retry/host/omit_canary_hosts/v3/BUILD | 12 ++ .../v3/omit_canary_hosts.proto | 7 +- .../retry/host}/previous_hosts/v3/BUILD | 5 +- .../previous_hosts/v3/previous_hosts.proto | 7 +- include/envoy/upstream/BUILD | 2 +- include/envoy/upstream/outlier_detection.h | 5 +- source/common/protobuf/utility.cc | 18 ++- source/common/upstream/BUILD | 2 +- .../common/upstream/outlier_detection_impl.cc | 118 ++++++++--------- .../common/upstream/outlier_detection_impl.h | 26 ++-- source/extensions/clusters/redis/BUILD | 2 +- .../clusters/redis/redis_cluster.cc | 8 +- .../extensions/clusters/redis/redis_cluster.h | 10 +- .../extensions/filters/http/on_demand/BUILD | 2 +- .../filters/http/on_demand/config.cc | 4 +- .../filters/http/on_demand/config.h | 10 +- .../filters/network/thrift_proxy/router/BUILD | 2 +- .../network/thrift_proxy/router/config.cc | 6 +- .../network/thrift_proxy/router/config.h | 9 +- source/extensions/health_checkers/redis/BUILD | 6 +- .../extensions/health_checkers/redis/config.h | 6 +- .../extensions/health_checkers/redis/redis.cc | 4 +- .../extensions/health_checkers/redis/redis.h | 4 +- .../health_checkers/redis/utility.h | 12 +- .../resource_monitors/fixed_heap/BUILD | 4 +- .../resource_monitors/fixed_heap/config.cc | 6 +- .../resource_monitors/fixed_heap/config.h | 8 +- .../fixed_heap/fixed_heap_monitor.cc | 4 +- .../fixed_heap/fixed_heap_monitor.h | 4 +- .../resource_monitors/injected_resource/BUILD | 4 +- .../injected_resource/config.cc | 6 +- .../injected_resource/config.h | 8 +- .../injected_resource_monitor.cc | 4 +- .../injected_resource_monitor.h | 4 +- .../retry/host/omit_canary_hosts/BUILD | 2 +- .../retry/host/omit_canary_hosts/config.h | 4 +- .../retry/host/previous_hosts/BUILD | 2 +- .../retry/host/previous_hosts/config.h | 5 +- .../retry/priority/previous_priorities/BUILD | 2 +- .../priority/previous_priorities/config.cc | 8 +- .../priority/previous_priorities/config.h | 6 +- .../transport_sockets/raw_buffer/BUILD | 2 +- .../transport_sockets/raw_buffer/config.cc | 6 +- test/common/protobuf/BUILD | 2 + test/common/protobuf/utility_test.cc | 17 +++ test/common/upstream/BUILD | 2 +- .../upstream/outlier_detection_impl_test.cc | 124 +++++++++--------- .../aggregate/cluster_integration_test.cc | 2 +- test/extensions/clusters/redis/BUILD | 4 +- test/extensions/clusters/redis/mocks.cc | 4 +- test/extensions/clusters/redis/mocks.h | 4 +- .../clusters/redis/redis_cluster_test.cc | 12 +- .../filters/network/redis_proxy/BUILD | 2 +- .../redis_proxy/conn_pool_impl_test.cc | 4 +- .../health_checkers/redis/config_test.cc | 8 +- .../health_checkers/redis/redis_test.cc | 12 +- .../integration/quic_http_integration_test.cc | 4 +- .../resource_monitors/fixed_heap/BUILD | 4 +- .../fixed_heap/config_test.cc | 6 +- .../fixed_heap/fixed_heap_monitor_test.cc | 6 +- .../resource_monitors/injected_resource/BUILD | 4 +- .../injected_resource/config_test.cc | 6 +- .../injected_resource_monitor_test.cc | 6 +- .../host/omit_canary_hosts/config_test.cc | 3 +- .../retry/host/previous_hosts/config_test.cc | 5 +- .../retry/priority/previous_priorities/BUILD | 2 +- .../previous_priorities/config_test.cc | 4 +- test/mocks/upstream/BUILD | 2 +- test/mocks/upstream/host.h | 4 +- .../type_whisperer/proto_build_targets_gen.py | 18 ++- 100 files changed, 632 insertions(+), 305 deletions(-) rename api/envoy/{config/retry/omit_canary_hosts => extensions/health_checkers/redis}/v3/BUILD (60%) create mode 100644 api/envoy/extensions/health_checkers/redis/v3/redis.proto create mode 100644 api/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD create mode 100644 api/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto create mode 100644 api/envoy/extensions/resource_monitors/injected_resource/v3/BUILD create mode 100644 api/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto create mode 100644 api/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD rename {generated_api_shadow/envoy/config/retry => api/envoy/extensions/retry/host}/omit_canary_hosts/v3/omit_canary_hosts.proto (53%) rename {generated_api_shadow/envoy/config/retry/omit_canary_hosts => api/envoy/extensions/retry/host/previous_hosts}/v3/BUILD (60%) rename {generated_api_shadow/envoy/config/retry => api/envoy/extensions/retry/host}/previous_hosts/v3/previous_hosts.proto (53%) rename {api/envoy/config/retry/previous_hosts => generated_api_shadow/envoy/extensions/health_checkers/redis}/v3/BUILD (60%) create mode 100644 generated_api_shadow/envoy/extensions/health_checkers/redis/v3/redis.proto create mode 100644 generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD create mode 100644 generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto create mode 100644 generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/BUILD create mode 100644 generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto create mode 100644 generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD rename {api/envoy/config/retry => generated_api_shadow/envoy/extensions/retry/host}/omit_canary_hosts/v3/omit_canary_hosts.proto (53%) rename generated_api_shadow/envoy/{config/retry => extensions/retry/host}/previous_hosts/v3/BUILD (60%) rename {api/envoy/config/retry => generated_api_shadow/envoy/extensions/retry/host}/previous_hosts/v3/previous_hosts.proto (53%) diff --git a/api/BUILD b/api/BUILD index 300420c00238..fdb210e26dd0 100644 --- a/api/BUILD +++ b/api/BUILD @@ -144,9 +144,7 @@ proto_library( "//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg", "//envoy/config/resource_monitor/injected_resource/v2alpha:pkg", "//envoy/config/retry/omit_canary_hosts/v2:pkg", - "//envoy/config/retry/omit_canary_hosts/v3:pkg", "//envoy/config/retry/previous_hosts/v2:pkg", - "//envoy/config/retry/previous_hosts/v3:pkg", "//envoy/config/route/v3:pkg", "//envoy/config/tap/v3:pkg", "//envoy/config/trace/v3:pkg", @@ -239,12 +237,17 @@ proto_library( "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", + "//envoy/extensions/health_checkers/redis/v3:pkg", "//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg", "//envoy/extensions/internal_redirect/previous_routes/v3:pkg", "//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg", "//envoy/extensions/network/socket_interface/v3:pkg", "//envoy/extensions/rate_limit_descriptors/expr/v3:pkg", + "//envoy/extensions/resource_monitors/fixed_heap/v3:pkg", + "//envoy/extensions/resource_monitors/injected_resource/v3:pkg", + "//envoy/extensions/retry/host/omit_canary_hosts/v3:pkg", "//envoy/extensions/retry/host/omit_host_metadata/v3:pkg", + "//envoy/extensions/retry/host/previous_hosts/v3:pkg", "//envoy/extensions/retry/priority/previous_priorities/v3:pkg", "//envoy/extensions/stat_sinks/wasm/v3:pkg", "//envoy/extensions/transport_sockets/alts/v3:pkg", diff --git a/api/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto b/api/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto index 107bf6fc2dbe..c2b2e58a1823 100644 --- a/api/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto +++ b/api/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto @@ -2,11 +2,14 @@ syntax = "proto3"; package envoy.config.retry.omit_canary_hosts.v2; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; option java_package = "io.envoyproxy.envoy.config.retry.omit_canary_hosts.v2"; option java_outer_classname = "OmitCanaryHostsProto"; option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.retry.host.omit_canary_hosts.v3"; option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Omit Canary Hosts Predicate] diff --git a/api/envoy/config/retry/previous_hosts/v2/previous_hosts.proto b/api/envoy/config/retry/previous_hosts/v2/previous_hosts.proto index e87e8cd70eaf..f69c5054f9c9 100644 --- a/api/envoy/config/retry/previous_hosts/v2/previous_hosts.proto +++ b/api/envoy/config/retry/previous_hosts/v2/previous_hosts.proto @@ -2,11 +2,14 @@ syntax = "proto3"; package envoy.config.retry.previous_hosts.v2; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; option java_package = "io.envoyproxy.envoy.config.retry.previous_hosts.v2"; option java_outer_classname = "PreviousHostsProto"; option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.retry.host.previous_hosts.v3"; option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Previous Hosts Predicate] diff --git a/api/envoy/config/retry/previous_priorities/previous_priorities_config.proto b/api/envoy/config/retry/previous_priorities/previous_priorities_config.proto index e96741178576..3fc400c053a7 100644 --- a/api/envoy/config/retry/previous_priorities/previous_priorities_config.proto +++ b/api/envoy/config/retry/previous_priorities/previous_priorities_config.proto @@ -2,12 +2,15 @@ syntax = "proto3"; package envoy.config.retry.previous_priorities; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.config.retry.previous_priorities"; option java_outer_classname = "PreviousPrioritiesConfigProto"; option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.retry.priority.previous_priorities.v3"; option (udpa.annotations.file_status).package_version_status = FROZEN; // [#protodoc-title: Previous priorities retry selector] diff --git a/api/envoy/config/retry/omit_canary_hosts/v3/BUILD b/api/envoy/extensions/health_checkers/redis/v3/BUILD similarity index 60% rename from api/envoy/config/retry/omit_canary_hosts/v3/BUILD rename to api/envoy/extensions/health_checkers/redis/v3/BUILD index ee92fb652582..1cb4c6154f26 100644 --- a/api/envoy/config/retry/omit_canary_hosts/v3/BUILD +++ b/api/envoy/extensions/health_checkers/redis/v3/BUILD @@ -5,5 +5,8 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") licenses(["notice"]) # Apache 2 api_proto_package( - deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], + deps = [ + "//envoy/config/health_checker/redis/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], ) diff --git a/api/envoy/extensions/health_checkers/redis/v3/redis.proto b/api/envoy/extensions/health_checkers/redis/v3/redis.proto new file mode 100644 index 000000000000..10f5c2b30b03 --- /dev/null +++ b/api/envoy/extensions/health_checkers/redis/v3/redis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package envoy.extensions.health_checkers.redis.v3; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.health_checkers.redis.v3"; +option java_outer_classname = "RedisProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Redis] +// Redis health checker :ref:`configuration overview `. +// [#extension: envoy.health_checkers.redis] + +message Redis { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.health_checker.redis.v2.Redis"; + + // If set, optionally perform ``EXISTS `` instead of ``PING``. A return value + // from Redis of 0 (does not exist) is considered a passing healthcheck. A return value other + // than 0 is considered a failure. This allows the user to mark a Redis instance for maintenance + // by setting the specified key to any value and waiting for traffic to drain. + string key = 1; +} diff --git a/api/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD b/api/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD new file mode 100644 index 000000000000..3fb51ff1ccaa --- /dev/null +++ b/api/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/api/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto b/api/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto new file mode 100644 index 000000000000..48aaa0a0268e --- /dev/null +++ b/api/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package envoy.extensions.resource_monitors.fixed_heap.v3; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.resource_monitors.fixed_heap.v3"; +option java_outer_classname = "FixedHeapProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Fixed heap] +// [#extension: envoy.resource_monitors.fixed_heap] + +// The fixed heap resource monitor reports the Envoy process memory pressure, computed as a +// fraction of currently reserved heap memory divided by a statically configured maximum +// specified in the FixedHeapConfig. +message FixedHeapConfig { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig"; + + uint64 max_heap_size_bytes = 1 [(validate.rules).uint64 = {gt: 0}]; +} diff --git a/api/envoy/extensions/resource_monitors/injected_resource/v3/BUILD b/api/envoy/extensions/resource_monitors/injected_resource/v3/BUILD new file mode 100644 index 000000000000..975b8fcbd5a3 --- /dev/null +++ b/api/envoy/extensions/resource_monitors/injected_resource/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/resource_monitor/injected_resource/v2alpha:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/api/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto b/api/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto new file mode 100644 index 000000000000..643ea68651c7 --- /dev/null +++ b/api/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package envoy.extensions.resource_monitors.injected_resource.v3; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.resource_monitors.injected_resource.v3"; +option java_outer_classname = "InjectedResourceProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Injected resource] +// [#extension: envoy.resource_monitors.injected_resource] + +// The injected resource monitor allows injecting a synthetic resource pressure into Envoy +// via a text file, which must contain a floating-point number in the range [0..1] representing +// the resource pressure and be updated atomically by a symbolic link swap. +// This is intended primarily for integration tests to force Envoy into an overloaded state. +message InjectedResourceConfig { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig"; + + string filename = 1 [(validate.rules).string = {min_len: 1}]; +} diff --git a/api/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD b/api/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD new file mode 100644 index 000000000000..0eab79b89fda --- /dev/null +++ b/api/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/retry/omit_canary_hosts/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v3/omit_canary_hosts.proto b/api/envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto similarity index 53% rename from generated_api_shadow/envoy/config/retry/omit_canary_hosts/v3/omit_canary_hosts.proto rename to api/envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto index fe928ba733db..930cced83703 100644 --- a/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v3/omit_canary_hosts.proto +++ b/api/envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package envoy.config.retry.omit_canary_hosts.v3; +package envoy.extensions.retry.host.omit_canary_hosts.v3; import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; -option java_package = "io.envoyproxy.envoy.config.retry.omit_canary_hosts.v3"; +option java_package = "io.envoyproxy.envoy.extensions.retry.host.omit_canary_hosts.v3"; option java_outer_classname = "OmitCanaryHostsProto"; option java_multiple_files = true; option (udpa.annotations.file_status).package_version_status = ACTIVE; @@ -13,4 +14,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#extension: envoy.retry_host_predicates.omit_canary_hosts] message OmitCanaryHostsPredicate { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.retry.omit_canary_hosts.v2.OmitCanaryHostsPredicate"; } diff --git a/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v3/BUILD b/api/envoy/extensions/retry/host/previous_hosts/v3/BUILD similarity index 60% rename from generated_api_shadow/envoy/config/retry/omit_canary_hosts/v3/BUILD rename to api/envoy/extensions/retry/host/previous_hosts/v3/BUILD index ee92fb652582..88d9a6e255a3 100644 --- a/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v3/BUILD +++ b/api/envoy/extensions/retry/host/previous_hosts/v3/BUILD @@ -5,5 +5,8 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") licenses(["notice"]) # Apache 2 api_proto_package( - deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], + deps = [ + "//envoy/config/retry/previous_hosts/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], ) diff --git a/generated_api_shadow/envoy/config/retry/previous_hosts/v3/previous_hosts.proto b/api/envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.proto similarity index 53% rename from generated_api_shadow/envoy/config/retry/previous_hosts/v3/previous_hosts.proto rename to api/envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.proto index 349802ebe92d..addce657fefe 100644 --- a/generated_api_shadow/envoy/config/retry/previous_hosts/v3/previous_hosts.proto +++ b/api/envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package envoy.config.retry.previous_hosts.v3; +package envoy.extensions.retry.host.previous_hosts.v3; import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; -option java_package = "io.envoyproxy.envoy.config.retry.previous_hosts.v3"; +option java_package = "io.envoyproxy.envoy.extensions.retry.host.previous_hosts.v3"; option java_outer_classname = "PreviousHostsProto"; option java_multiple_files = true; option (udpa.annotations.file_status).package_version_status = ACTIVE; @@ -13,4 +14,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#extension: envoy.retry_host_predicates.previous_hosts] message PreviousHostsPredicate { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.retry.previous_hosts.v2.PreviousHostsPredicate"; } diff --git a/api/versioning/BUILD b/api/versioning/BUILD index d041dbc02fbc..8603a4883a68 100644 --- a/api/versioning/BUILD +++ b/api/versioning/BUILD @@ -27,9 +27,7 @@ proto_library( "//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg", "//envoy/config/resource_monitor/injected_resource/v2alpha:pkg", "//envoy/config/retry/omit_canary_hosts/v2:pkg", - "//envoy/config/retry/omit_canary_hosts/v3:pkg", "//envoy/config/retry/previous_hosts/v2:pkg", - "//envoy/config/retry/previous_hosts/v3:pkg", "//envoy/config/route/v3:pkg", "//envoy/config/tap/v3:pkg", "//envoy/config/trace/v3:pkg", @@ -122,12 +120,17 @@ proto_library( "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", + "//envoy/extensions/health_checkers/redis/v3:pkg", "//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg", "//envoy/extensions/internal_redirect/previous_routes/v3:pkg", "//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg", "//envoy/extensions/network/socket_interface/v3:pkg", "//envoy/extensions/rate_limit_descriptors/expr/v3:pkg", + "//envoy/extensions/resource_monitors/fixed_heap/v3:pkg", + "//envoy/extensions/resource_monitors/injected_resource/v3:pkg", + "//envoy/extensions/retry/host/omit_canary_hosts/v3:pkg", "//envoy/extensions/retry/host/omit_host_metadata/v3:pkg", + "//envoy/extensions/retry/host/previous_hosts/v3:pkg", "//envoy/extensions/retry/priority/previous_priorities/v3:pkg", "//envoy/extensions/stat_sinks/wasm/v3:pkg", "//envoy/extensions/transport_sockets/alts/v3:pkg", diff --git a/docs/root/api-v3/config/health_checker/health_checker.rst b/docs/root/api-v3/config/health_checker/health_checker.rst index 3e5d28372505..b533d675ad7b 100644 --- a/docs/root/api-v3/config/health_checker/health_checker.rst +++ b/docs/root/api-v3/config/health_checker/health_checker.rst @@ -5,4 +5,5 @@ Health checkers :glob: :maxdepth: 2 - */v2/* \ No newline at end of file + */v2/* + ../../extensions/health_checkers/*/v3/* diff --git a/docs/root/api-v3/config/resource_monitor/resource_monitor.rst b/docs/root/api-v3/config/resource_monitor/resource_monitor.rst index ef47ad7dca3e..c755d656cc8b 100644 --- a/docs/root/api-v3/config/resource_monitor/resource_monitor.rst +++ b/docs/root/api-v3/config/resource_monitor/resource_monitor.rst @@ -7,4 +7,5 @@ Resource monitors :glob: :maxdepth: 2 + ../../extensions/resource_monitors/*/v3/* */v2alpha/* diff --git a/docs/root/api-v3/config/retry/retry.rst b/docs/root/api-v3/config/retry/retry.rst index 75b69edd2bc1..2ba4572ab2ed 100644 --- a/docs/root/api-v3/config/retry/retry.rst +++ b/docs/root/api-v3/config/retry/retry.rst @@ -7,5 +7,4 @@ Retry Predicates */empty/* */v2/* - */v3/* ../../extensions/retry/**/v3/* diff --git a/docs/root/configuration/upstream/health_checkers/redis.rst b/docs/root/configuration/upstream/health_checkers/redis.rst index 03ad07741e67..306fb96c17a5 100644 --- a/docs/root/configuration/upstream/health_checkers/redis.rst +++ b/docs/root/configuration/upstream/health_checkers/redis.rst @@ -8,7 +8,7 @@ which checks Redis upstream hosts. It sends a Redis PING command and expect a PO Redis server can respond with anything other than PONG to cause an immediate active health check failure. Optionally, Envoy can perform EXISTS on a user-specified key. If the key does not exist it is considered a passing health check. This allows the user to mark a Redis instance for maintenance by setting the -specified :ref:`key ` to any value and waiting +specified :ref:`key ` to any value and waiting for traffic to drain. An example setting for :ref:`custom_health_check ` as a diff --git a/docs/root/intro/arch_overview/upstream/health_checking.rst b/docs/root/intro/arch_overview/upstream/health_checking.rst index d1ec07bd7280..267542070ef4 100644 --- a/docs/root/intro/arch_overview/upstream/health_checking.rst +++ b/docs/root/intro/arch_overview/upstream/health_checking.rst @@ -24,7 +24,7 @@ unhealthy, successes required before marking a host healthy, etc.): failure. Optionally, Envoy can perform EXISTS on a user-specified key. If the key does not exist it is considered a passing healthcheck. This allows the user to mark a Redis instance for maintenance by setting the specified key to any value and waiting for traffic to drain. See - :ref:`redis_key `. + :ref:`redis_key `. Health checks occur over the transport socket specified for the cluster. This implies that if a cluster is using a TLS-enabled transport socket, the health check will also occur over TLS. The diff --git a/generated_api_shadow/BUILD b/generated_api_shadow/BUILD index effde23bad70..fdb210e26dd0 100644 --- a/generated_api_shadow/BUILD +++ b/generated_api_shadow/BUILD @@ -144,7 +144,6 @@ proto_library( "//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg", "//envoy/config/resource_monitor/injected_resource/v2alpha:pkg", "//envoy/config/retry/omit_canary_hosts/v2:pkg", - "//envoy/config/retry/omit_canary_hosts/v3:pkg", "//envoy/config/retry/previous_hosts/v2:pkg", "//envoy/config/route/v3:pkg", "//envoy/config/tap/v3:pkg", @@ -238,12 +237,17 @@ proto_library( "//envoy/extensions/filters/network/zookeeper_proxy/v3:pkg", "//envoy/extensions/filters/udp/dns_filter/v3alpha:pkg", "//envoy/extensions/filters/udp/udp_proxy/v3:pkg", + "//envoy/extensions/health_checkers/redis/v3:pkg", "//envoy/extensions/internal_redirect/allow_listed_routes/v3:pkg", "//envoy/extensions/internal_redirect/previous_routes/v3:pkg", "//envoy/extensions/internal_redirect/safe_cross_scheme/v3:pkg", "//envoy/extensions/network/socket_interface/v3:pkg", "//envoy/extensions/rate_limit_descriptors/expr/v3:pkg", + "//envoy/extensions/resource_monitors/fixed_heap/v3:pkg", + "//envoy/extensions/resource_monitors/injected_resource/v3:pkg", + "//envoy/extensions/retry/host/omit_canary_hosts/v3:pkg", "//envoy/extensions/retry/host/omit_host_metadata/v3:pkg", + "//envoy/extensions/retry/host/previous_hosts/v3:pkg", "//envoy/extensions/retry/priority/previous_priorities/v3:pkg", "//envoy/extensions/stat_sinks/wasm/v3:pkg", "//envoy/extensions/transport_sockets/alts/v3:pkg", diff --git a/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto b/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto index 107bf6fc2dbe..c2b2e58a1823 100644 --- a/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto +++ b/generated_api_shadow/envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.proto @@ -2,11 +2,14 @@ syntax = "proto3"; package envoy.config.retry.omit_canary_hosts.v2; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; option java_package = "io.envoyproxy.envoy.config.retry.omit_canary_hosts.v2"; option java_outer_classname = "OmitCanaryHostsProto"; option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.retry.host.omit_canary_hosts.v3"; option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Omit Canary Hosts Predicate] diff --git a/generated_api_shadow/envoy/config/retry/previous_hosts/v2/previous_hosts.proto b/generated_api_shadow/envoy/config/retry/previous_hosts/v2/previous_hosts.proto index e87e8cd70eaf..f69c5054f9c9 100644 --- a/generated_api_shadow/envoy/config/retry/previous_hosts/v2/previous_hosts.proto +++ b/generated_api_shadow/envoy/config/retry/previous_hosts/v2/previous_hosts.proto @@ -2,11 +2,14 @@ syntax = "proto3"; package envoy.config.retry.previous_hosts.v2; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; option java_package = "io.envoyproxy.envoy.config.retry.previous_hosts.v2"; option java_outer_classname = "PreviousHostsProto"; option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.retry.host.previous_hosts.v3"; option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Previous Hosts Predicate] diff --git a/generated_api_shadow/envoy/config/retry/previous_priorities/previous_priorities_config.proto b/generated_api_shadow/envoy/config/retry/previous_priorities/previous_priorities_config.proto index e96741178576..3fc400c053a7 100644 --- a/generated_api_shadow/envoy/config/retry/previous_priorities/previous_priorities_config.proto +++ b/generated_api_shadow/envoy/config/retry/previous_priorities/previous_priorities_config.proto @@ -2,12 +2,15 @@ syntax = "proto3"; package envoy.config.retry.previous_priorities; +import "udpa/annotations/migrate.proto"; import "udpa/annotations/status.proto"; import "validate/validate.proto"; option java_package = "io.envoyproxy.envoy.config.retry.previous_priorities"; option java_outer_classname = "PreviousPrioritiesConfigProto"; option java_multiple_files = true; +option (udpa.annotations.file_migrate).move_to_package = + "envoy.extensions.retry.priority.previous_priorities.v3"; option (udpa.annotations.file_status).package_version_status = FROZEN; // [#protodoc-title: Previous priorities retry selector] diff --git a/api/envoy/config/retry/previous_hosts/v3/BUILD b/generated_api_shadow/envoy/extensions/health_checkers/redis/v3/BUILD similarity index 60% rename from api/envoy/config/retry/previous_hosts/v3/BUILD rename to generated_api_shadow/envoy/extensions/health_checkers/redis/v3/BUILD index ee92fb652582..1cb4c6154f26 100644 --- a/api/envoy/config/retry/previous_hosts/v3/BUILD +++ b/generated_api_shadow/envoy/extensions/health_checkers/redis/v3/BUILD @@ -5,5 +5,8 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") licenses(["notice"]) # Apache 2 api_proto_package( - deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], + deps = [ + "//envoy/config/health_checker/redis/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], ) diff --git a/generated_api_shadow/envoy/extensions/health_checkers/redis/v3/redis.proto b/generated_api_shadow/envoy/extensions/health_checkers/redis/v3/redis.proto new file mode 100644 index 000000000000..10f5c2b30b03 --- /dev/null +++ b/generated_api_shadow/envoy/extensions/health_checkers/redis/v3/redis.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package envoy.extensions.health_checkers.redis.v3; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.health_checkers.redis.v3"; +option java_outer_classname = "RedisProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Redis] +// Redis health checker :ref:`configuration overview `. +// [#extension: envoy.health_checkers.redis] + +message Redis { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.health_checker.redis.v2.Redis"; + + // If set, optionally perform ``EXISTS `` instead of ``PING``. A return value + // from Redis of 0 (does not exist) is considered a passing healthcheck. A return value other + // than 0 is considered a failure. This allows the user to mark a Redis instance for maintenance + // by setting the specified key to any value and waiting for traffic to drain. + string key = 1; +} diff --git a/generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD b/generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD new file mode 100644 index 000000000000..3fb51ff1ccaa --- /dev/null +++ b/generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto b/generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto new file mode 100644 index 000000000000..48aaa0a0268e --- /dev/null +++ b/generated_api_shadow/envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package envoy.extensions.resource_monitors.fixed_heap.v3; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.resource_monitors.fixed_heap.v3"; +option java_outer_classname = "FixedHeapProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Fixed heap] +// [#extension: envoy.resource_monitors.fixed_heap] + +// The fixed heap resource monitor reports the Envoy process memory pressure, computed as a +// fraction of currently reserved heap memory divided by a statically configured maximum +// specified in the FixedHeapConfig. +message FixedHeapConfig { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig"; + + uint64 max_heap_size_bytes = 1 [(validate.rules).uint64 = {gt: 0}]; +} diff --git a/generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/BUILD b/generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/BUILD new file mode 100644 index 000000000000..975b8fcbd5a3 --- /dev/null +++ b/generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/resource_monitor/injected_resource/v2alpha:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto b/generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto new file mode 100644 index 000000000000..643ea68651c7 --- /dev/null +++ b/generated_api_shadow/envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package envoy.extensions.resource_monitors.injected_resource.v3; + +import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; +import "validate/validate.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.resource_monitors.injected_resource.v3"; +option java_outer_classname = "InjectedResourceProto"; +option java_multiple_files = true; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: Injected resource] +// [#extension: envoy.resource_monitors.injected_resource] + +// The injected resource monitor allows injecting a synthetic resource pressure into Envoy +// via a text file, which must contain a floating-point number in the range [0..1] representing +// the resource pressure and be updated atomically by a symbolic link swap. +// This is intended primarily for integration tests to force Envoy into an overloaded state. +message InjectedResourceConfig { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig"; + + string filename = 1 [(validate.rules).string = {min_len: 1}]; +} diff --git a/generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD b/generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD new file mode 100644 index 000000000000..0eab79b89fda --- /dev/null +++ b/generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/BUILD @@ -0,0 +1,12 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = [ + "//envoy/config/retry/omit_canary_hosts/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], +) diff --git a/api/envoy/config/retry/omit_canary_hosts/v3/omit_canary_hosts.proto b/generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto similarity index 53% rename from api/envoy/config/retry/omit_canary_hosts/v3/omit_canary_hosts.proto rename to generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto index fe928ba733db..930cced83703 100644 --- a/api/envoy/config/retry/omit_canary_hosts/v3/omit_canary_hosts.proto +++ b/generated_api_shadow/envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package envoy.config.retry.omit_canary_hosts.v3; +package envoy.extensions.retry.host.omit_canary_hosts.v3; import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; -option java_package = "io.envoyproxy.envoy.config.retry.omit_canary_hosts.v3"; +option java_package = "io.envoyproxy.envoy.extensions.retry.host.omit_canary_hosts.v3"; option java_outer_classname = "OmitCanaryHostsProto"; option java_multiple_files = true; option (udpa.annotations.file_status).package_version_status = ACTIVE; @@ -13,4 +14,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#extension: envoy.retry_host_predicates.omit_canary_hosts] message OmitCanaryHostsPredicate { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.retry.omit_canary_hosts.v2.OmitCanaryHostsPredicate"; } diff --git a/generated_api_shadow/envoy/config/retry/previous_hosts/v3/BUILD b/generated_api_shadow/envoy/extensions/retry/host/previous_hosts/v3/BUILD similarity index 60% rename from generated_api_shadow/envoy/config/retry/previous_hosts/v3/BUILD rename to generated_api_shadow/envoy/extensions/retry/host/previous_hosts/v3/BUILD index ee92fb652582..88d9a6e255a3 100644 --- a/generated_api_shadow/envoy/config/retry/previous_hosts/v3/BUILD +++ b/generated_api_shadow/envoy/extensions/retry/host/previous_hosts/v3/BUILD @@ -5,5 +5,8 @@ load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") licenses(["notice"]) # Apache 2 api_proto_package( - deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], + deps = [ + "//envoy/config/retry/previous_hosts/v2:pkg", + "@com_github_cncf_udpa//udpa/annotations:pkg", + ], ) diff --git a/api/envoy/config/retry/previous_hosts/v3/previous_hosts.proto b/generated_api_shadow/envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.proto similarity index 53% rename from api/envoy/config/retry/previous_hosts/v3/previous_hosts.proto rename to generated_api_shadow/envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.proto index 349802ebe92d..addce657fefe 100644 --- a/api/envoy/config/retry/previous_hosts/v3/previous_hosts.proto +++ b/generated_api_shadow/envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.proto @@ -1,10 +1,11 @@ syntax = "proto3"; -package envoy.config.retry.previous_hosts.v3; +package envoy.extensions.retry.host.previous_hosts.v3; import "udpa/annotations/status.proto"; +import "udpa/annotations/versioning.proto"; -option java_package = "io.envoyproxy.envoy.config.retry.previous_hosts.v3"; +option java_package = "io.envoyproxy.envoy.extensions.retry.host.previous_hosts.v3"; option java_outer_classname = "PreviousHostsProto"; option java_multiple_files = true; option (udpa.annotations.file_status).package_version_status = ACTIVE; @@ -13,4 +14,6 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#extension: envoy.retry_host_predicates.previous_hosts] message PreviousHostsPredicate { + option (udpa.annotations.versioning).previous_message_type = + "envoy.config.retry.previous_hosts.v2.PreviousHostsPredicate"; } diff --git a/include/envoy/upstream/BUILD b/include/envoy/upstream/BUILD index d67f7b242f40..c66dea9b8ee9 100644 --- a/include/envoy/upstream/BUILD +++ b/include/envoy/upstream/BUILD @@ -101,7 +101,7 @@ envoy_cc_library( external_deps = ["abseil_optional"], deps = [ "//include/envoy/common:time_interface", - "@envoy_api//envoy/data/cluster/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/data/cluster/v3:pkg_cc_proto", ], ) diff --git a/include/envoy/upstream/outlier_detection.h b/include/envoy/upstream/outlier_detection.h index cd20e95a8e45..038e81b88e29 100644 --- a/include/envoy/upstream/outlier_detection.h +++ b/include/envoy/upstream/outlier_detection.h @@ -7,7 +7,7 @@ #include "envoy/common/pure.h" #include "envoy/common/time.h" -#include "envoy/data/cluster/v2alpha/outlier_detection_event.pb.h" +#include "envoy/data/cluster/v3/outlier_detection_event.pb.h" #include "absl/types/optional.h" @@ -169,8 +169,7 @@ class EventLogger { * @param enforced is true if the ejection took place; false, if only logging took place. */ virtual void logEject(const HostDescriptionConstSharedPtr& host, Detector& detector, - envoy::data::cluster::v2alpha::OutlierEjectionType type, - bool enforced) PURE; + envoy::data::cluster::v3::OutlierEjectionType type, bool enforced) PURE; /** * Log an unejection event. diff --git a/source/common/protobuf/utility.cc b/source/common/protobuf/utility.cc index eee9f4701a8e..d76443203949 100644 --- a/source/common/protobuf/utility.cc +++ b/source/common/protobuf/utility.cc @@ -27,6 +27,19 @@ using namespace std::chrono_literals; namespace Envoy { namespace { +// For historical reasons, these v2 protos are allowed in v3 and will not be removed during the v2 +// turndown. +static const absl::flat_hash_set& v2ProtosAllowedInV3() { + CONSTRUCT_ON_FIRST_USE( + absl::flat_hash_set, + {"envoy.config.health_checker.redis.v2.Redis", + "envoy.config.filter.thrift.router.v2alpha1.Router", + "envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig", + "envoy.config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig", + "envoy.config.retry.omit_canary_hosts.v2.OmitCanaryHostsPredicate", + "envoy.config.retry.previous_hosts.v2.PreviousHostsPredicate"}); +} + absl::string_view filenameFromPath(absl::string_view full_path) { size_t index = full_path.rfind("/"); if (index == std::string::npos || index == full_path.size()) { @@ -671,7 +684,10 @@ void MessageUtil::unpackTo(const ProtobufWkt::Any& any_message, Protobuf::Messag any_message_with_fixup.DebugString())); } Config::VersionConverter::annotateWithOriginalType(*earlier_version_desc, message); - MessageUtil::onVersionUpgradeDeprecation(any_full_name); + // We allow some v2 protos in v3 for historical reasons. + if (v2ProtosAllowedInV3().count(any_full_name) == 0) { + MessageUtil::onVersionUpgradeDeprecation(any_full_name); + } return; } } diff --git a/source/common/upstream/BUILD b/source/common/upstream/BUILD index edfe095f1f8a..318e0c285d03 100644 --- a/source/common/upstream/BUILD +++ b/source/common/upstream/BUILD @@ -316,7 +316,7 @@ envoy_cc_library( "//source/common/http:codes_lib", "//source/common/protobuf", "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", - "@envoy_api//envoy/data/cluster/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/data/cluster/v3:pkg_cc_proto", ], ) diff --git a/source/common/upstream/outlier_detection_impl.cc b/source/common/upstream/outlier_detection_impl.cc index 6cf0c3aade41..94b656c7b9bc 100644 --- a/source/common/upstream/outlier_detection_impl.cc +++ b/source/common/upstream/outlier_detection_impl.cc @@ -8,7 +8,7 @@ #include "envoy/config/cluster/v3/cluster.pb.h" #include "envoy/config/cluster/v3/outlier_detection.pb.h" -#include "envoy/data/cluster/v2alpha/outlier_detection_event.pb.h" +#include "envoy/data/cluster/v3/outlier_detection_event.pb.h" #include "envoy/event/dispatcher.h" #include "envoy/stats/scope.h" @@ -39,8 +39,8 @@ DetectorHostMonitorImpl::DetectorHostMonitorImpl(std::shared_ptr d HostSharedPtr host) : detector_(detector), host_(host), // add Success Rate monitors - external_origin_sr_monitor_(envoy::data::cluster::v2alpha::SUCCESS_RATE), - local_origin_sr_monitor_(envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN) { + external_origin_sr_monitor_(envoy::data::cluster::v3::SUCCESS_RATE), + local_origin_sr_monitor_(envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN) { // Setup method to call when putResult is invoked. Depending on the config's // split_external_local_origin_errors_ boolean value different method is called. put_result_func_ = detector->config().splitExternalLocalOriginErrors() @@ -363,27 +363,27 @@ void DetectorImpl::checkHostForUneject(HostSharedPtr host, DetectorHostMonitorIm } } -bool DetectorImpl::enforceEjection(envoy::data::cluster::v2alpha::OutlierEjectionType type) { +bool DetectorImpl::enforceEjection(envoy::data::cluster::v3::OutlierEjectionType type) { switch (type) { - case envoy::data::cluster::v2alpha::CONSECUTIVE_5XX: + case envoy::data::cluster::v3::CONSECUTIVE_5XX: return runtime_.snapshot().featureEnabled(EnforcingConsecutive5xxRuntime, config_.enforcingConsecutive5xx()); - case envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE: return runtime_.snapshot().featureEnabled(EnforcingConsecutiveGatewayFailureRuntime, config_.enforcingConsecutiveGatewayFailure()); - case envoy::data::cluster::v2alpha::SUCCESS_RATE: + case envoy::data::cluster::v3::SUCCESS_RATE: return runtime_.snapshot().featureEnabled(EnforcingSuccessRateRuntime, config_.enforcingSuccessRate()); - case envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: return runtime_.snapshot().featureEnabled(EnforcingConsecutiveLocalOriginFailureRuntime, config_.enforcingConsecutiveLocalOriginFailure()); - case envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN: + case envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN: return runtime_.snapshot().featureEnabled(EnforcingLocalOriginSuccessRateRuntime, config_.enforcingLocalOriginSuccessRate()); - case envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE: + case envoy::data::cluster::v3::FAILURE_PERCENTAGE: return runtime_.snapshot().featureEnabled(EnforcingFailurePercentageRuntime, config_.enforcingFailurePercentage()); - case envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE_LOCAL_ORIGIN: + case envoy::data::cluster::v3::FAILURE_PERCENTAGE_LOCAL_ORIGIN: return runtime_.snapshot().featureEnabled(EnforcingFailurePercentageLocalOriginRuntime, config_.enforcingFailurePercentageLocalOrigin()); default: @@ -394,29 +394,28 @@ bool DetectorImpl::enforceEjection(envoy::data::cluster::v2alpha::OutlierEjectio NOT_REACHED_GCOVR_EXCL_LINE; } -void DetectorImpl::updateEnforcedEjectionStats( - envoy::data::cluster::v2alpha::OutlierEjectionType type) { +void DetectorImpl::updateEnforcedEjectionStats(envoy::data::cluster::v3::OutlierEjectionType type) { stats_.ejections_enforced_total_.inc(); switch (type) { - case envoy::data::cluster::v2alpha::SUCCESS_RATE: + case envoy::data::cluster::v3::SUCCESS_RATE: stats_.ejections_enforced_success_rate_.inc(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_5XX: + case envoy::data::cluster::v3::CONSECUTIVE_5XX: stats_.ejections_enforced_consecutive_5xx_.inc(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE: stats_.ejections_enforced_consecutive_gateway_failure_.inc(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: stats_.ejections_enforced_consecutive_local_origin_failure_.inc(); break; - case envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN: + case envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN: stats_.ejections_enforced_local_origin_success_rate_.inc(); break; - case envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE: + case envoy::data::cluster::v3::FAILURE_PERCENTAGE: stats_.ejections_enforced_failure_percentage_.inc(); break; - case envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE_LOCAL_ORIGIN: + case envoy::data::cluster::v3::FAILURE_PERCENTAGE_LOCAL_ORIGIN: stats_.ejections_enforced_local_origin_failure_percentage_.inc(); break; default: @@ -425,28 +424,27 @@ void DetectorImpl::updateEnforcedEjectionStats( } } -void DetectorImpl::updateDetectedEjectionStats( - envoy::data::cluster::v2alpha::OutlierEjectionType type) { +void DetectorImpl::updateDetectedEjectionStats(envoy::data::cluster::v3::OutlierEjectionType type) { switch (type) { - case envoy::data::cluster::v2alpha::SUCCESS_RATE: + case envoy::data::cluster::v3::SUCCESS_RATE: stats_.ejections_detected_success_rate_.inc(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_5XX: + case envoy::data::cluster::v3::CONSECUTIVE_5XX: stats_.ejections_detected_consecutive_5xx_.inc(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE: stats_.ejections_detected_consecutive_gateway_failure_.inc(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: stats_.ejections_detected_consecutive_local_origin_failure_.inc(); break; - case envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN: + case envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN: stats_.ejections_detected_local_origin_success_rate_.inc(); break; - case envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE: + case envoy::data::cluster::v3::FAILURE_PERCENTAGE: stats_.ejections_detected_failure_percentage_.inc(); break; - case envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE_LOCAL_ORIGIN: + case envoy::data::cluster::v3::FAILURE_PERCENTAGE_LOCAL_ORIGIN: stats_.ejections_detected_local_origin_failure_percentage_.inc(); break; default: @@ -456,15 +454,15 @@ void DetectorImpl::updateDetectedEjectionStats( } void DetectorImpl::ejectHost(HostSharedPtr host, - envoy::data::cluster::v2alpha::OutlierEjectionType type) { + envoy::data::cluster::v3::OutlierEjectionType type) { uint64_t max_ejection_percent = std::min( 100, runtime_.snapshot().getInteger(MaxEjectionPercentRuntime, config_.maxEjectionPercent())); double ejected_percent = 100.0 * ejections_active_helper_.value() / host_monitors_.size(); // Note this is not currently checked per-priority level, so it is possible // for outlier detection to eject all hosts at any given priority level. if (ejected_percent < max_ejection_percent) { - if (type == envoy::data::cluster::v2alpha::CONSECUTIVE_5XX || - type == envoy::data::cluster::v2alpha::SUCCESS_RATE) { + if (type == envoy::data::cluster::v3::CONSECUTIVE_5XX || + type == envoy::data::cluster::v3::SUCCESS_RATE) { // Deprecated counter, preserving old behaviour until it's removed. stats_.ejections_total_.inc(); } @@ -502,7 +500,7 @@ DetectionStats DetectorImpl::generateStats(Stats::Scope& scope) { } void DetectorImpl::notifyMainThreadConsecutiveError( - HostSharedPtr host, envoy::data::cluster::v2alpha::OutlierEjectionType type) { + HostSharedPtr host, envoy::data::cluster::v3::OutlierEjectionType type) { // This event will come from all threads, so we synchronize with a post to the main thread. // NOTE: Unfortunately consecutive errors are complicated from a threading perspective because // we catch consecutive errors on worker threads and then post back to the main thread. @@ -523,21 +521,20 @@ void DetectorImpl::notifyMainThreadConsecutiveError( } void DetectorImpl::onConsecutive5xx(HostSharedPtr host) { - notifyMainThreadConsecutiveError(host, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX); + notifyMainThreadConsecutiveError(host, envoy::data::cluster::v3::CONSECUTIVE_5XX); } void DetectorImpl::onConsecutiveGatewayFailure(HostSharedPtr host) { - notifyMainThreadConsecutiveError(host, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE); + notifyMainThreadConsecutiveError(host, envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE); } void DetectorImpl::onConsecutiveLocalOriginFailure(HostSharedPtr host) { notifyMainThreadConsecutiveError(host, - envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE); + envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE); } -void DetectorImpl::onConsecutiveErrorWorker( - HostSharedPtr host, envoy::data::cluster::v2alpha::OutlierEjectionType type) { +void DetectorImpl::onConsecutiveErrorWorker(HostSharedPtr host, + envoy::data::cluster::v3::OutlierEjectionType type) { // Ejections come in cross thread. There is a chance that the host has already been removed from // the set. If so, just ignore it. if (host_monitors_.count(host) == 0) { @@ -554,14 +551,14 @@ void DetectorImpl::onConsecutiveErrorWorker( // reset counters switch (type) { - case envoy::data::cluster::v2alpha::CONSECUTIVE_5XX: + case envoy::data::cluster::v3::CONSECUTIVE_5XX: stats_.ejections_consecutive_5xx_.inc(); // Deprecated host_monitors_[host]->resetConsecutive5xx(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE: host_monitors_[host]->resetConsecutiveGatewayFailure(); break; - case envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: + case envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE: host_monitors_[host]->resetConsecutiveLocalOriginFailure(); break; default: @@ -669,7 +666,7 @@ void DetectorImpl::processSuccessRateEjections( for (const auto& host_success_rate_pair : valid_success_rate_hosts) { if (host_success_rate_pair.success_rate_ < success_rate_ejection_threshold) { stats_.ejections_success_rate_.inc(); // Deprecated. - const envoy::data::cluster::v2alpha::OutlierEjectionType type = + const envoy::data::cluster::v3::OutlierEjectionType type = host_monitors_[host_success_rate_pair.host_] ->getSRMonitor(monitor_type) .getEjectionType(); @@ -690,10 +687,10 @@ void DetectorImpl::processSuccessRateEjections( // The ejection type returned by the SuccessRateMonitor's getEjectionType() will be a // SUCCESS_RATE type, so we need to figure it out for ourselves. - const envoy::data::cluster::v2alpha::OutlierEjectionType type = + const envoy::data::cluster::v3::OutlierEjectionType type = (monitor_type == DetectorHostMonitor::SuccessRateMonitorType::ExternalOrigin) - ? envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE - : envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE_LOCAL_ORIGIN; + ? envoy::data::cluster::v3::FAILURE_PERCENTAGE + : envoy::data::cluster::v3::FAILURE_PERCENTAGE_LOCAL_ORIGIN; updateDetectedEjectionStats(type); ejectHost(host_success_rate_pair.host_, type); } @@ -728,22 +725,21 @@ void DetectorImpl::runCallbacks(HostSharedPtr host) { } void EventLoggerImpl::logEject(const HostDescriptionConstSharedPtr& host, Detector& detector, - envoy::data::cluster::v2alpha::OutlierEjectionType type, - bool enforced) { - envoy::data::cluster::v2alpha::OutlierDetectionEvent event; + envoy::data::cluster::v3::OutlierEjectionType type, bool enforced) { + envoy::data::cluster::v3::OutlierDetectionEvent event; event.set_type(type); absl::optional time = host->outlierDetector().lastUnejectionTime(); setCommonEventParams(event, host, time); - event.set_action(envoy::data::cluster::v2alpha::EJECT); + event.set_action(envoy::data::cluster::v3::EJECT); event.set_enforced(enforced); - if ((type == envoy::data::cluster::v2alpha::SUCCESS_RATE) || - (type == envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN)) { + if ((type == envoy::data::cluster::v3::SUCCESS_RATE) || + (type == envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN)) { const DetectorHostMonitor::SuccessRateMonitorType monitor_type = - (type == envoy::data::cluster::v2alpha::SUCCESS_RATE) + (type == envoy::data::cluster::v3::SUCCESS_RATE) ? DetectorHostMonitor::SuccessRateMonitorType::ExternalOrigin : DetectorHostMonitor::SuccessRateMonitorType::LocalOrigin; event.mutable_eject_success_rate_event()->set_cluster_average_success_rate( @@ -752,10 +748,10 @@ void EventLoggerImpl::logEject(const HostDescriptionConstSharedPtr& host, Detect detector.successRateEjectionThreshold(monitor_type)); event.mutable_eject_success_rate_event()->set_host_success_rate( host->outlierDetector().successRate(monitor_type)); - } else if ((type == envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE) || - (type == envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE_LOCAL_ORIGIN)) { + } else if ((type == envoy::data::cluster::v3::FAILURE_PERCENTAGE) || + (type == envoy::data::cluster::v3::FAILURE_PERCENTAGE_LOCAL_ORIGIN)) { const DetectorHostMonitor::SuccessRateMonitorType monitor_type = - (type == envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE) + (type == envoy::data::cluster::v3::FAILURE_PERCENTAGE) ? DetectorHostMonitor::SuccessRateMonitorType::ExternalOrigin : DetectorHostMonitor::SuccessRateMonitorType::LocalOrigin; event.mutable_eject_failure_percentage_event()->set_host_success_rate( @@ -771,12 +767,12 @@ void EventLoggerImpl::logEject(const HostDescriptionConstSharedPtr& host, Detect } void EventLoggerImpl::logUneject(const HostDescriptionConstSharedPtr& host) { - envoy::data::cluster::v2alpha::OutlierDetectionEvent event; + envoy::data::cluster::v3::OutlierDetectionEvent event; absl::optional time = host->outlierDetector().lastEjectionTime(); setCommonEventParams(event, host, time); - event.set_action(envoy::data::cluster::v2alpha::UNEJECT); + event.set_action(envoy::data::cluster::v3::UNEJECT); const auto json = MessageUtil::getJsonStringFromMessageOrError(event, /* pretty_print */ false, @@ -784,9 +780,9 @@ void EventLoggerImpl::logUneject(const HostDescriptionConstSharedPtr& host) { file_->write(fmt::format("{}\n", json)); } -void EventLoggerImpl::setCommonEventParams( - envoy::data::cluster::v2alpha::OutlierDetectionEvent& event, - const HostDescriptionConstSharedPtr& host, absl::optional time) { +void EventLoggerImpl::setCommonEventParams(envoy::data::cluster::v3::OutlierDetectionEvent& event, + const HostDescriptionConstSharedPtr& host, + absl::optional time) { MonotonicTime monotonic_now = time_source_.monotonicTime(); if (time) { std::chrono::seconds secsFromLastAction = diff --git a/source/common/upstream/outlier_detection_impl.h b/source/common/upstream/outlier_detection_impl.h index cf4b6adcdf44..f4e3b9ce5617 100644 --- a/source/common/upstream/outlier_detection_impl.h +++ b/source/common/upstream/outlier_detection_impl.h @@ -12,7 +12,7 @@ #include "envoy/common/time.h" #include "envoy/config/cluster/v3/cluster.pb.h" #include "envoy/config/cluster/v3/outlier_detection.pb.h" -#include "envoy/data/cluster/v2alpha/outlier_detection_event.pb.h" +#include "envoy/data/cluster/v3/outlier_detection_event.pb.h" #include "envoy/event/timer.h" #include "envoy/http/codes.h" #include "envoy/runtime/runtime.h" @@ -105,7 +105,7 @@ class SuccessRateAccumulator { class SuccessRateMonitor { public: - SuccessRateMonitor(envoy::data::cluster::v2alpha::OutlierEjectionType ejection_type) + SuccessRateMonitor(envoy::data::cluster::v3::OutlierEjectionType ejection_type) : ejection_type_(ejection_type), success_rate_(-1) { // Point the success_rate_accumulator_bucket_ pointer to a bucket. updateCurrentSuccessRateBucket(); @@ -121,14 +121,12 @@ class SuccessRateMonitor { success_rate_accumulator_bucket_.load()->success_request_counter_++; } - envoy::data::cluster::v2alpha::OutlierEjectionType getEjectionType() const { - return ejection_type_; - } + envoy::data::cluster::v3::OutlierEjectionType getEjectionType() const { return ejection_type_; } private: SuccessRateAccumulator success_rate_accumulator_; std::atomic success_rate_accumulator_bucket_; - envoy::data::cluster::v2alpha::OutlierEjectionType ejection_type_; + envoy::data::cluster::v3::OutlierEjectionType ejection_type_; double success_rate_; }; @@ -421,18 +419,18 @@ class DetectorImpl : public Detector, public std::enable_shared_from_this time); diff --git a/source/extensions/clusters/redis/BUILD b/source/extensions/clusters/redis/BUILD index 784103719061..8ef0c0315c47 100644 --- a/source/extensions/clusters/redis/BUILD +++ b/source/extensions/clusters/redis/BUILD @@ -69,9 +69,9 @@ envoy_cc_extension( "//source/extensions/filters/network/redis_proxy:config", "//source/extensions/transport_sockets/raw_buffer:config", "//source/server:transport_socket_config_lib", - "@envoy_api//envoy/config/cluster/redis:pkg_cc_proto", "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", "@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/clusters/redis/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/clusters/redis/redis_cluster.cc b/source/extensions/clusters/redis/redis_cluster.cc index 7565936db273..297248a6b6a1 100644 --- a/source/extensions/clusters/redis/redis_cluster.cc +++ b/source/extensions/clusters/redis/redis_cluster.cc @@ -1,8 +1,8 @@ #include "redis_cluster.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h" #include "envoy/config/cluster/v3/cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" @@ -17,7 +17,7 @@ Extensions::NetworkFilters::Common::Redis::Client::DoNothingPoolCallbacks null_p RedisCluster::RedisCluster( const envoy::config::cluster::v3::Cluster& cluster, - const envoy::config::cluster::redis::RedisClusterConfig& redis_cluster, + const envoy::extensions::clusters::redis::v3::RedisClusterConfig& redis_cluster, NetworkFilters::Common::Redis::Client::ClientFactory& redis_client_factory, Upstream::ClusterManager& cluster_manager, Runtime::Loader& runtime, Api::Api& api, Network::DnsResolverSharedPtr dns_resolver, @@ -381,7 +381,7 @@ RedisCluster::ClusterSlotsRequest RedisCluster::ClusterSlotsRequest::instance_; std::pair RedisClusterFactory::createClusterWithConfig( const envoy::config::cluster::v3::Cluster& cluster, - const envoy::config::cluster::redis::RedisClusterConfig& proto_config, + const envoy::extensions::clusters::redis::v3::RedisClusterConfig& proto_config, Upstream::ClusterFactoryContext& context, Envoy::Server::Configuration::TransportSocketFactoryContextImpl& socket_factory_context, Envoy::Stats::ScopePtr&& stats_scope) { diff --git a/source/extensions/clusters/redis/redis_cluster.h b/source/extensions/clusters/redis/redis_cluster.h index 9707954dedee..49af6d50d1be 100644 --- a/source/extensions/clusters/redis/redis_cluster.h +++ b/source/extensions/clusters/redis/redis_cluster.h @@ -14,14 +14,14 @@ #include "envoy/api/api.h" #include "envoy/common/random_generator.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h" #include "envoy/config/cluster/v3/cluster.pb.h" #include "envoy/config/endpoint/v3/endpoint.pb.h" #include "envoy/config/endpoint/v3/endpoint_components.pb.h" #include "envoy/config/typed_metadata.h" #include "envoy/event/dispatcher.h" #include "envoy/event/timer.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" #include "envoy/http/codec.h" @@ -95,7 +95,7 @@ namespace Redis { class RedisCluster : public Upstream::BaseDynamicClusterImpl { public: RedisCluster(const envoy::config::cluster::v3::Cluster& cluster, - const envoy::config::cluster::redis::RedisClusterConfig& redis_cluster, + const envoy::extensions::clusters::redis::v3::RedisClusterConfig& redis_cluster, NetworkFilters::Common::Redis::Client::ClientFactory& client_factory, Upstream::ClusterManager& cluster_manager, Runtime::Loader& runtime, Api::Api& api, Network::DnsResolverSharedPtr dns_resolver, @@ -290,7 +290,7 @@ class RedisCluster : public Upstream::BaseDynamicClusterImpl { }; class RedisClusterFactory : public Upstream::ConfigurableClusterFactoryBase< - envoy::config::cluster::redis::RedisClusterConfig> { + envoy::extensions::clusters::redis::v3::RedisClusterConfig> { public: RedisClusterFactory() : ConfigurableClusterFactoryBase(Extensions::Clusters::ClusterTypes::get().Redis) {} @@ -301,7 +301,7 @@ class RedisClusterFactory : public Upstream::ConfigurableClusterFactoryBase< std::pair createClusterWithConfig( const envoy::config::cluster::v3::Cluster& cluster, - const envoy::config::cluster::redis::RedisClusterConfig& proto_config, + const envoy::extensions::clusters::redis::v3::RedisClusterConfig& proto_config, Upstream::ClusterFactoryContext& context, Server::Configuration::TransportSocketFactoryContextImpl& socket_factory_context, Stats::ScopePtr&& stats_scope) override; diff --git a/source/extensions/filters/http/on_demand/BUILD b/source/extensions/filters/http/on_demand/BUILD index 04a8037484d2..9199ad50cd49 100644 --- a/source/extensions/filters/http/on_demand/BUILD +++ b/source/extensions/filters/http/on_demand/BUILD @@ -41,6 +41,6 @@ envoy_cc_extension( "//source/extensions/filters/http:well_known_names", "//source/extensions/filters/http/common:factory_base_lib", "//source/extensions/filters/http/on_demand:on_demand_update_lib", - "@envoy_api//envoy/config/filter/http/on_demand/v2:pkg_cc_proto", + "@envoy_api//envoy/extensions/filters/http/on_demand/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/filters/http/on_demand/config.cc b/source/extensions/filters/http/on_demand/config.cc index b86756078c58..42d07ef4dca6 100644 --- a/source/extensions/filters/http/on_demand/config.cc +++ b/source/extensions/filters/http/on_demand/config.cc @@ -1,6 +1,6 @@ #include "extensions/filters/http/on_demand/config.h" -#include "envoy/config/filter/http/on_demand/v2/on_demand.pb.validate.h" +#include "envoy/extensions/filters/http/on_demand/v3/on_demand.pb.validate.h" #include "extensions/filters/http/on_demand/on_demand_update.h" @@ -10,7 +10,7 @@ namespace HttpFilters { namespace OnDemand { Http::FilterFactoryCb OnDemandFilterFactory::createFilterFactoryFromProtoTyped( - const envoy::config::filter::http::on_demand::v2::OnDemand&, const std::string&, + const envoy::extensions::filters::http::on_demand::v3::OnDemand&, const std::string&, Server::Configuration::FactoryContext&) { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamDecoderFilter( diff --git a/source/extensions/filters/http/on_demand/config.h b/source/extensions/filters/http/on_demand/config.h index 88556a869470..eb48654ab34c 100644 --- a/source/extensions/filters/http/on_demand/config.h +++ b/source/extensions/filters/http/on_demand/config.h @@ -1,7 +1,7 @@ #pragma once -#include "envoy/config/filter/http/on_demand/v2/on_demand.pb.h" -#include "envoy/config/filter/http/on_demand/v2/on_demand.pb.validate.h" +#include "envoy/extensions/filters/http/on_demand/v3/on_demand.pb.h" +#include "envoy/extensions/filters/http/on_demand/v3/on_demand.pb.validate.h" #include "extensions/filters/http/common/factory_base.h" #include "extensions/filters/http/well_known_names.h" @@ -15,14 +15,14 @@ namespace OnDemand { * Config registration for the OnDemand filter. @see NamedHttpFilterConfigFactory. */ class OnDemandFilterFactory - : public Common::FactoryBase { + : public Common::FactoryBase { public: OnDemandFilterFactory() : FactoryBase(HttpFilterNames::get().OnDemand) {} private: Http::FilterFactoryCb createFilterFactoryFromProtoTyped( - const envoy::config::filter::http::on_demand::v2::OnDemand& proto_config, const std::string&, - Server::Configuration::FactoryContext& context) override; + const envoy::extensions::filters::http::on_demand::v3::OnDemand& proto_config, + const std::string&, Server::Configuration::FactoryContext& context) override; }; } // namespace OnDemand diff --git a/source/extensions/filters/network/thrift_proxy/router/BUILD b/source/extensions/filters/network/thrift_proxy/router/BUILD index 00e32bbf06a2..0d6df8076440 100644 --- a/source/extensions/filters/network/thrift_proxy/router/BUILD +++ b/source/extensions/filters/network/thrift_proxy/router/BUILD @@ -20,7 +20,7 @@ envoy_cc_extension( "//source/extensions/filters/network/thrift_proxy/filters:factory_base_lib", "//source/extensions/filters/network/thrift_proxy/filters:filter_config_interface", "//source/extensions/filters/network/thrift_proxy/filters:well_known_names", - "@envoy_api//envoy/config/filter/thrift/router/v2alpha1:pkg_cc_proto", + "@envoy_api//envoy/extensions/filters/network/thrift_proxy/router/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/filters/network/thrift_proxy/router/config.cc b/source/extensions/filters/network/thrift_proxy/router/config.cc index 88b11a357da2..b6a055445aa6 100644 --- a/source/extensions/filters/network/thrift_proxy/router/config.cc +++ b/source/extensions/filters/network/thrift_proxy/router/config.cc @@ -1,7 +1,7 @@ #include "extensions/filters/network/thrift_proxy/router/config.h" -#include "envoy/config/filter/thrift/router/v2alpha1/router.pb.h" -#include "envoy/config/filter/thrift/router/v2alpha1/router.pb.validate.h" +#include "envoy/extensions/filters/network/thrift_proxy/router/v3/router.pb.h" +#include "envoy/extensions/filters/network/thrift_proxy/router/v3/router.pb.validate.h" #include "envoy/registry/registry.h" #include "extensions/filters/network/thrift_proxy/router/router_impl.h" @@ -13,7 +13,7 @@ namespace ThriftProxy { namespace Router { ThriftFilters::FilterFactoryCb RouterFilterConfig::createFilterFactoryFromProtoTyped( - const envoy::config::filter::thrift::router::v2alpha1::Router& proto_config, + const envoy::extensions::filters::network::thrift_proxy::router::v3::Router& proto_config, const std::string& stat_prefix, Server::Configuration::FactoryContext& context) { UNREFERENCED_PARAMETER(proto_config); diff --git a/source/extensions/filters/network/thrift_proxy/router/config.h b/source/extensions/filters/network/thrift_proxy/router/config.h index 7b24ff99eb6b..7c712d8621cc 100644 --- a/source/extensions/filters/network/thrift_proxy/router/config.h +++ b/source/extensions/filters/network/thrift_proxy/router/config.h @@ -1,7 +1,7 @@ #pragma once -#include "envoy/config/filter/thrift/router/v2alpha1/router.pb.h" -#include "envoy/config/filter/thrift/router/v2alpha1/router.pb.validate.h" +#include "envoy/extensions/filters/network/thrift_proxy/router/v3/router.pb.h" +#include "envoy/extensions/filters/network/thrift_proxy/router/v3/router.pb.validate.h" #include "extensions/filters/network/thrift_proxy/filters/factory_base.h" #include "extensions/filters/network/thrift_proxy/filters/well_known_names.h" @@ -13,13 +13,14 @@ namespace ThriftProxy { namespace Router { class RouterFilterConfig - : public ThriftFilters::FactoryBase { + : public ThriftFilters::FactoryBase< + envoy::extensions::filters::network::thrift_proxy::router::v3::Router> { public: RouterFilterConfig() : FactoryBase(ThriftFilters::ThriftFilterNames::get().ROUTER) {} private: ThriftFilters::FilterFactoryCb createFilterFactoryFromProtoTyped( - const envoy::config::filter::thrift::router::v2alpha1::Router& proto_config, + const envoy::extensions::filters::network::thrift_proxy::router::v3::Router& proto_config, const std::string& stat_prefix, Server::Configuration::FactoryContext& context) override; }; diff --git a/source/extensions/health_checkers/redis/BUILD b/source/extensions/health_checkers/redis/BUILD index 3bc89797ab32..7eac535e46ee 100644 --- a/source/extensions/health_checkers/redis/BUILD +++ b/source/extensions/health_checkers/redis/BUILD @@ -21,9 +21,9 @@ envoy_cc_library( "//source/extensions/filters/network/redis_proxy:config", "//source/extensions/filters/network/redis_proxy:conn_pool_lib", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", - "@envoy_api//envoy/config/health_checker/redis/v2:pkg_cc_proto", "@envoy_api//envoy/data/core/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/health_checkers/redis/v3:pkg_cc_proto", ], ) @@ -40,8 +40,8 @@ envoy_cc_extension( "//source/common/common:assert_lib", "//source/extensions/health_checkers:well_known_names", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", - "@envoy_api//envoy/config/health_checker/redis/v2:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/health_checkers/redis/v3:pkg_cc_proto", ], ) @@ -53,6 +53,6 @@ envoy_cc_library( "//source/common/protobuf", "//source/common/protobuf:utility_lib", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", - "@envoy_api//envoy/config/health_checker/redis/v2:pkg_cc_proto", + "@envoy_api//envoy/extensions/health_checkers/redis/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/health_checkers/redis/config.h b/source/extensions/health_checkers/redis/config.h index 7a8f8676291d..e51cb8b256cb 100644 --- a/source/extensions/health_checkers/redis/config.h +++ b/source/extensions/health_checkers/redis/config.h @@ -1,10 +1,10 @@ #pragma once #include "envoy/config/core/v3/health_check.pb.h" -#include "envoy/config/health_checker/redis/v2/redis.pb.h" -#include "envoy/config/health_checker/redis/v2/redis.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.validate.h" #include "envoy/server/health_checker_config.h" #include "extensions/health_checkers/redis/redis.h" @@ -26,7 +26,7 @@ class RedisHealthCheckerFactory : public Server::Configuration::CustomHealthChec std::string name() const override { return HealthCheckerNames::get().RedisHealthChecker; } ProtobufTypes::MessagePtr createEmptyConfigProto() override { - return ProtobufTypes::MessagePtr{new envoy::config::health_checker::redis::v2::Redis()}; + return ProtobufTypes::MessagePtr{new envoy::extensions::health_checkers::redis::v3::Redis()}; } }; diff --git a/source/extensions/health_checkers/redis/redis.cc b/source/extensions/health_checkers/redis/redis.cc index 045aa56b8d0e..6d188c5e2b06 100644 --- a/source/extensions/health_checkers/redis/redis.cc +++ b/source/extensions/health_checkers/redis/redis.cc @@ -1,10 +1,10 @@ #include "extensions/health_checkers/redis/redis.h" #include "envoy/config/core/v3/health_check.pb.h" -#include "envoy/config/health_checker/redis/v2/redis.pb.h" #include "envoy/data/core/v3/health_check_event.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.h" namespace Envoy { namespace Extensions { @@ -13,7 +13,7 @@ namespace RedisHealthChecker { RedisHealthChecker::RedisHealthChecker( const Upstream::Cluster& cluster, const envoy::config::core::v3::HealthCheck& config, - const envoy::config::health_checker::redis::v2::Redis& redis_config, + const envoy::extensions::health_checkers::redis::v3::Redis& redis_config, Event::Dispatcher& dispatcher, Runtime::Loader& runtime, Upstream::HealthCheckEventLoggerPtr&& event_logger, Api::Api& api, Extensions::NetworkFilters::Common::Redis::Client::ClientFactory& client_factory) diff --git a/source/extensions/health_checkers/redis/redis.h b/source/extensions/health_checkers/redis/redis.h index 455f7c0c503c..1639e98e9c14 100644 --- a/source/extensions/health_checkers/redis/redis.h +++ b/source/extensions/health_checkers/redis/redis.h @@ -4,10 +4,10 @@ #include "envoy/api/api.h" #include "envoy/config/core/v3/health_check.pb.h" -#include "envoy/config/health_checker/redis/v2/redis.pb.h" #include "envoy/data/core/v3/health_check_event.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.h" #include "common/upstream/health_checker_base_impl.h" @@ -27,7 +27,7 @@ class RedisHealthChecker : public Upstream::HealthCheckerImplBase { public: RedisHealthChecker( const Upstream::Cluster& cluster, const envoy::config::core::v3::HealthCheck& config, - const envoy::config::health_checker::redis::v2::Redis& redis_config, + const envoy::extensions::health_checkers::redis::v3::Redis& redis_config, Event::Dispatcher& dispatcher, Runtime::Loader& runtime, Upstream::HealthCheckEventLoggerPtr&& event_logger, Api::Api& api, Extensions::NetworkFilters::Common::Redis::Client::ClientFactory& client_factory); diff --git a/source/extensions/health_checkers/redis/utility.h b/source/extensions/health_checkers/redis/utility.h index 9c74e3c21b3a..25bfd9887309 100644 --- a/source/extensions/health_checkers/redis/utility.h +++ b/source/extensions/health_checkers/redis/utility.h @@ -1,8 +1,8 @@ #pragma once #include "envoy/config/core/v3/health_check.pb.h" -#include "envoy/config/health_checker/redis/v2/redis.pb.h" -#include "envoy/config/health_checker/redis/v2/redis.pb.validate.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.validate.h" #include "common/config/utility.h" #include "common/protobuf/protobuf.h" @@ -15,17 +15,17 @@ namespace RedisHealthChecker { namespace { -static const envoy::config::health_checker::redis::v2::Redis +static const envoy::extensions::health_checkers::redis::v3::Redis getRedisHealthCheckConfig(const envoy::config::core::v3::HealthCheck& health_check_config, ProtobufMessage::ValidationVisitor& validation_visitor) { ProtobufTypes::MessagePtr config = - ProtobufTypes::MessagePtr{new envoy::config::health_checker::redis::v2::Redis()}; + ProtobufTypes::MessagePtr{new envoy::extensions::health_checkers::redis::v3::Redis()}; Envoy::Config::Utility::translateOpaqueConfig( health_check_config.custom_health_check().typed_config(), health_check_config.custom_health_check().hidden_envoy_deprecated_config(), validation_visitor, *config); - return MessageUtil::downcastAndValidate( - *config, validation_visitor); + return MessageUtil::downcastAndValidate< + const envoy::extensions::health_checkers::redis::v3::Redis&>(*config, validation_visitor); } } // namespace diff --git a/source/extensions/resource_monitors/fixed_heap/BUILD b/source/extensions/resource_monitors/fixed_heap/BUILD index 6c2022537d3d..e55a8e5c5207 100644 --- a/source/extensions/resource_monitors/fixed_heap/BUILD +++ b/source/extensions/resource_monitors/fixed_heap/BUILD @@ -17,7 +17,7 @@ envoy_cc_library( "//include/envoy/server:resource_monitor_config_interface", "//source/common/common:assert_lib", "//source/common/memory:stats_lib", - "@envoy_api//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/fixed_heap/v3:pkg_cc_proto", ], ) @@ -33,6 +33,6 @@ envoy_cc_extension( "//source/common/common:assert_lib", "//source/extensions/resource_monitors:well_known_names", "//source/extensions/resource_monitors/common:factory_base_lib", - "@envoy_api//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/fixed_heap/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/resource_monitors/fixed_heap/config.cc b/source/extensions/resource_monitors/fixed_heap/config.cc index a8c5e4175ec5..df498656e218 100644 --- a/source/extensions/resource_monitors/fixed_heap/config.cc +++ b/source/extensions/resource_monitors/fixed_heap/config.cc @@ -1,7 +1,7 @@ #include "extensions/resource_monitors/fixed_heap/config.h" -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.h" -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.validate.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.validate.h" #include "envoy/registry/registry.h" #include "common/protobuf/utility.h" @@ -14,7 +14,7 @@ namespace ResourceMonitors { namespace FixedHeapMonitor { Server::ResourceMonitorPtr FixedHeapMonitorFactory::createResourceMonitorFromProtoTyped( - const envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig& config, + const envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig& config, Server::Configuration::ResourceMonitorFactoryContext& /*unused_context*/) { return std::make_unique(config); } diff --git a/source/extensions/resource_monitors/fixed_heap/config.h b/source/extensions/resource_monitors/fixed_heap/config.h index 26be00d731be..4c822719abea 100644 --- a/source/extensions/resource_monitors/fixed_heap/config.h +++ b/source/extensions/resource_monitors/fixed_heap/config.h @@ -1,7 +1,7 @@ #pragma once -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.h" -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.validate.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.validate.h" #include "envoy/server/resource_monitor_config.h" #include "extensions/resource_monitors/common/factory_base.h" @@ -14,13 +14,13 @@ namespace FixedHeapMonitor { class FixedHeapMonitorFactory : public Common::FactoryBase< - envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig> { + envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig> { public: FixedHeapMonitorFactory() : FactoryBase(ResourceMonitorNames::get().FixedHeap) {} private: Server::ResourceMonitorPtr createResourceMonitorFromProtoTyped( - const envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig& config, + const envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig& config, Server::Configuration::ResourceMonitorFactoryContext& context) override; }; diff --git a/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.cc b/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.cc index 17bc6c95406f..b97227e35bea 100644 --- a/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.cc +++ b/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.cc @@ -1,6 +1,6 @@ #include "extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h" -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.h" #include "common/common/assert.h" #include "common/memory/stats.h" @@ -15,7 +15,7 @@ uint64_t MemoryStatsReader::reservedHeapBytes() { return Memory::Stats::totalCur uint64_t MemoryStatsReader::unmappedHeapBytes() { return Memory::Stats::totalPageHeapUnmapped(); } FixedHeapMonitor::FixedHeapMonitor( - const envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig& config, + const envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig& config, std::unique_ptr stats) : max_heap_(config.max_heap_size_bytes()), stats_(std::move(stats)) { ASSERT(max_heap_ > 0); diff --git a/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h b/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h index 8ac0cee6928b..a54162ebb31f 100644 --- a/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h +++ b/source/extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h @@ -1,6 +1,6 @@ #pragma once -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.h" #include "envoy/server/resource_monitor.h" namespace Envoy { @@ -28,7 +28,7 @@ class MemoryStatsReader { class FixedHeapMonitor : public Server::ResourceMonitor { public: FixedHeapMonitor( - const envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig& config, + const envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig& config, std::unique_ptr stats = std::make_unique()); void updateResourceUsage(Server::ResourceMonitor::Callbacks& callbacks) override; diff --git a/source/extensions/resource_monitors/injected_resource/BUILD b/source/extensions/resource_monitors/injected_resource/BUILD index 6cff7be112ee..c047d6682af7 100644 --- a/source/extensions/resource_monitors/injected_resource/BUILD +++ b/source/extensions/resource_monitors/injected_resource/BUILD @@ -18,7 +18,7 @@ envoy_cc_library( "//include/envoy/filesystem:filesystem_interface", "//include/envoy/server:resource_monitor_config_interface", "//source/common/common:assert_lib", - "@envoy_api//envoy/config/resource_monitor/injected_resource/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/injected_resource/v3:pkg_cc_proto", ], ) @@ -38,6 +38,6 @@ envoy_cc_extension( "//source/common/common:assert_lib", "//source/extensions/resource_monitors:well_known_names", "//source/extensions/resource_monitors/common:factory_base_lib", - "@envoy_api//envoy/config/resource_monitor/injected_resource/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/injected_resource/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/resource_monitors/injected_resource/config.cc b/source/extensions/resource_monitors/injected_resource/config.cc index 1b98a86cad0a..2db6abd8b8a9 100644 --- a/source/extensions/resource_monitors/injected_resource/config.cc +++ b/source/extensions/resource_monitors/injected_resource/config.cc @@ -1,7 +1,7 @@ #include "extensions/resource_monitors/injected_resource/config.h" -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.h" -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.validate.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.validate.h" #include "envoy/registry/registry.h" #include "common/protobuf/utility.h" @@ -14,7 +14,7 @@ namespace ResourceMonitors { namespace InjectedResourceMonitor { Server::ResourceMonitorPtr InjectedResourceMonitorFactory::createResourceMonitorFromProtoTyped( - const envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig& + const envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig& config, Server::Configuration::ResourceMonitorFactoryContext& context) { return std::make_unique(config, context); diff --git a/source/extensions/resource_monitors/injected_resource/config.h b/source/extensions/resource_monitors/injected_resource/config.h index 95d8e77ccb6a..cbbd5abd49a7 100644 --- a/source/extensions/resource_monitors/injected_resource/config.h +++ b/source/extensions/resource_monitors/injected_resource/config.h @@ -1,7 +1,7 @@ #pragma once -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.h" -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.validate.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.validate.h" #include "envoy/server/resource_monitor_config.h" #include "extensions/resource_monitors/common/factory_base.h" @@ -14,13 +14,13 @@ namespace InjectedResourceMonitor { class InjectedResourceMonitorFactory : public Common::FactoryBase< - envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig> { + envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig> { public: InjectedResourceMonitorFactory() : FactoryBase(ResourceMonitorNames::get().InjectedResource) {} private: Server::ResourceMonitorPtr createResourceMonitorFromProtoTyped( - const envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig& + const envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig& config, Server::Configuration::ResourceMonitorFactoryContext& context) override; }; diff --git a/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.cc b/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.cc index ccc8d24d32c5..354d5970b43f 100644 --- a/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.cc +++ b/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.cc @@ -1,6 +1,6 @@ #include "extensions/resource_monitors/injected_resource/injected_resource_monitor.h" -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.h" #include "common/common/assert.h" @@ -12,7 +12,7 @@ namespace ResourceMonitors { namespace InjectedResourceMonitor { InjectedResourceMonitor::InjectedResourceMonitor( - const envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig& + const envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig& config, Server::Configuration::ResourceMonitorFactoryContext& context) : filename_(config.filename()), file_changed_(true), diff --git a/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.h b/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.h index d2609f3f383a..86210c112a07 100644 --- a/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.h +++ b/source/extensions/resource_monitors/injected_resource/injected_resource_monitor.h @@ -1,7 +1,7 @@ #pragma once #include "envoy/api/api.h" -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.h" #include "envoy/filesystem/filesystem.h" #include "envoy/server/resource_monitor.h" #include "envoy/server/resource_monitor_config.h" @@ -20,7 +20,7 @@ namespace InjectedResourceMonitor { class InjectedResourceMonitor : public Server::ResourceMonitor { public: InjectedResourceMonitor( - const envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig& + const envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig& config, Server::Configuration::ResourceMonitorFactoryContext& context); diff --git a/source/extensions/retry/host/omit_canary_hosts/BUILD b/source/extensions/retry/host/omit_canary_hosts/BUILD index 9427fa9fc507..720b9c6be7a8 100644 --- a/source/extensions/retry/host/omit_canary_hosts/BUILD +++ b/source/extensions/retry/host/omit_canary_hosts/BUILD @@ -26,6 +26,6 @@ envoy_cc_extension( ":omit_canary_hosts_predicate_lib", "//include/envoy/registry", "//include/envoy/upstream:retry_interface", - "@envoy_api//envoy/config/retry/omit_canary_hosts/v2:pkg_cc_proto", + "@envoy_api//envoy/extensions/retry/host/omit_canary_hosts/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/retry/host/omit_canary_hosts/config.h b/source/extensions/retry/host/omit_canary_hosts/config.h index d453bc8c8506..b59d7b2906ca 100644 --- a/source/extensions/retry/host/omit_canary_hosts/config.h +++ b/source/extensions/retry/host/omit_canary_hosts/config.h @@ -1,4 +1,4 @@ -#include "envoy/config/retry/omit_canary_hosts/v2/omit_canary_hosts.pb.validate.h" +#include "envoy/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.pb.validate.h" #include "envoy/upstream/retry.h" #include "extensions/retry/host/omit_canary_hosts/omit_canary_hosts.h" @@ -20,7 +20,7 @@ class OmitCanaryHostsRetryPredicateFactory : public Upstream::RetryHostPredicate ProtobufTypes::MessagePtr createEmptyConfigProto() override { return std::make_unique< - envoy::config::retry::omit_canary_hosts::v2::OmitCanaryHostsPredicate>(); + envoy::extensions::retry::host::omit_canary_hosts::v3::OmitCanaryHostsPredicate>(); } }; diff --git a/source/extensions/retry/host/previous_hosts/BUILD b/source/extensions/retry/host/previous_hosts/BUILD index 78e78b1a330e..048020638512 100644 --- a/source/extensions/retry/host/previous_hosts/BUILD +++ b/source/extensions/retry/host/previous_hosts/BUILD @@ -26,6 +26,6 @@ envoy_cc_extension( ":previous_hosts_predicate_lib", "//include/envoy/registry", "//include/envoy/upstream:retry_interface", - "@envoy_api//envoy/config/retry/previous_hosts/v2:pkg_cc_proto", + "@envoy_api//envoy/extensions/retry/host/previous_hosts/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/retry/host/previous_hosts/config.h b/source/extensions/retry/host/previous_hosts/config.h index 201290d5be99..1622242b1102 100644 --- a/source/extensions/retry/host/previous_hosts/config.h +++ b/source/extensions/retry/host/previous_hosts/config.h @@ -1,6 +1,6 @@ #pragma once -#include "envoy/config/retry/previous_hosts/v2/previous_hosts.pb.validate.h" +#include "envoy/extensions/retry/host/previous_hosts/v3/previous_hosts.pb.validate.h" #include "envoy/upstream/retry.h" #include "extensions/retry/host/previous_hosts/previous_hosts.h" @@ -20,7 +20,8 @@ class PreviousHostsRetryPredicateFactory : public Upstream::RetryHostPredicateFa std::string name() const override { return "envoy.retry_host_predicates.previous_hosts"; } ProtobufTypes::MessagePtr createEmptyConfigProto() override { - return std::make_unique(); + return std::make_unique< + envoy::extensions::retry::host::previous_hosts::v3::PreviousHostsPredicate>(); } }; diff --git a/source/extensions/retry/priority/previous_priorities/BUILD b/source/extensions/retry/priority/previous_priorities/BUILD index 66a592d9c772..08862b35cc48 100644 --- a/source/extensions/retry/priority/previous_priorities/BUILD +++ b/source/extensions/retry/priority/previous_priorities/BUILD @@ -30,6 +30,6 @@ envoy_cc_extension( "//include/envoy/upstream:retry_interface", "//source/common/protobuf", "//source/extensions/retry/priority:well_known_names", - "@envoy_api//envoy/config/retry/previous_priorities:pkg_cc_proto", + "@envoy_api//envoy/extensions/retry/priority/previous_priorities/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/retry/priority/previous_priorities/config.cc b/source/extensions/retry/priority/previous_priorities/config.cc index de7766c0d5a6..39756f51ff86 100644 --- a/source/extensions/retry/priority/previous_priorities/config.cc +++ b/source/extensions/retry/priority/previous_priorities/config.cc @@ -1,7 +1,7 @@ #include "extensions/retry/priority/previous_priorities/config.h" -#include "envoy/config/retry/previous_priorities/previous_priorities_config.pb.h" -#include "envoy/config/retry/previous_priorities/previous_priorities_config.pb.validate.h" +#include "envoy/extensions/retry/priority/previous_priorities/v3/previous_priorities_config.pb.h" +#include "envoy/extensions/retry/priority/previous_priorities/v3/previous_priorities_config.pb.validate.h" #include "envoy/registry/registry.h" #include "envoy/upstream/retry.h" @@ -15,8 +15,8 @@ Upstream::RetryPrioritySharedPtr PreviousPrioritiesRetryPriorityFactory::createR uint32_t max_retries) { return std::make_shared( - MessageUtil::downcastAndValidate< - const envoy::config::retry::previous_priorities::PreviousPrioritiesConfig&>( + MessageUtil::downcastAndValidate( config, validation_visitor) .update_frequency(), max_retries); diff --git a/source/extensions/retry/priority/previous_priorities/config.h b/source/extensions/retry/priority/previous_priorities/config.h index 10a9156aa208..3976a94f3297 100644 --- a/source/extensions/retry/priority/previous_priorities/config.h +++ b/source/extensions/retry/priority/previous_priorities/config.h @@ -1,6 +1,6 @@ #pragma once -#include "envoy/config/retry/previous_priorities/previous_priorities_config.pb.h" +#include "envoy/extensions/retry/priority/previous_priorities/v3/previous_priorities_config.pb.h" #include "envoy/upstream/retry.h" #include "common/protobuf/protobuf.h" @@ -25,8 +25,8 @@ class PreviousPrioritiesRetryPriorityFactory : public Upstream::RetryPriorityFac } ProtobufTypes::MessagePtr createEmptyConfigProto() override { - return ProtobufTypes::MessagePtr( - new envoy::config::retry::previous_priorities::PreviousPrioritiesConfig()); + return ProtobufTypes::MessagePtr(new envoy::extensions::retry::priority::previous_priorities:: + v3::PreviousPrioritiesConfig()); } }; diff --git a/source/extensions/transport_sockets/raw_buffer/BUILD b/source/extensions/transport_sockets/raw_buffer/BUILD index 3d4b41c96cde..c18d6349e968 100644 --- a/source/extensions/transport_sockets/raw_buffer/BUILD +++ b/source/extensions/transport_sockets/raw_buffer/BUILD @@ -23,6 +23,6 @@ envoy_cc_extension( "//include/envoy/server:transport_socket_config_interface", "//source/common/network:raw_buffer_socket_lib", "//source/extensions/transport_sockets:well_known_names", - "@envoy_api//envoy/config/transport_socket/raw_buffer/v2:pkg_cc_proto", + "@envoy_api//envoy/extensions/transport_sockets/raw_buffer/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/transport_sockets/raw_buffer/config.cc b/source/extensions/transport_sockets/raw_buffer/config.cc index 1bb073c0f3a5..b77df99bc96b 100644 --- a/source/extensions/transport_sockets/raw_buffer/config.cc +++ b/source/extensions/transport_sockets/raw_buffer/config.cc @@ -2,8 +2,8 @@ #include -#include "envoy/config/transport_socket/raw_buffer/v2/raw_buffer.pb.h" -#include "envoy/config/transport_socket/raw_buffer/v2/raw_buffer.pb.validate.h" +#include "envoy/extensions/transport_sockets/raw_buffer/v3/raw_buffer.pb.h" +#include "envoy/extensions/transport_sockets/raw_buffer/v3/raw_buffer.pb.validate.h" #include "common/network/raw_buffer_socket.h" @@ -24,7 +24,7 @@ Network::TransportSocketFactoryPtr DownstreamRawBufferSocketFactory::createTrans } ProtobufTypes::MessagePtr RawBufferSocketFactory::createEmptyConfigProto() { - return std::make_unique(); + return std::make_unique(); } REGISTER_FACTORY(UpstreamRawBufferSocketFactory, diff --git a/test/common/protobuf/BUILD b/test/common/protobuf/BUILD index bad3b85b77ab..e022b00f52b0 100644 --- a/test/common/protobuf/BUILD +++ b/test/common/protobuf/BUILD @@ -43,6 +43,8 @@ envoy_cc_test( "@envoy_api//envoy/config/bootstrap/v3:pkg_cc_proto", "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", + "@envoy_api//envoy/config/health_checker/redis/v2:pkg_cc_proto", + "@envoy_api//envoy/extensions/health_checkers/redis/v3:pkg_cc_proto", "@envoy_api//envoy/type/v3:pkg_cc_proto", ], ) diff --git a/test/common/protobuf/utility_test.cc b/test/common/protobuf/utility_test.cc index af3c86e45e7a..99d916259766 100644 --- a/test/common/protobuf/utility_test.cc +++ b/test/common/protobuf/utility_test.cc @@ -8,6 +8,10 @@ #include "envoy/config/cluster/v3/filter.pb.h" #include "envoy/config/cluster/v3/filter.pb.validate.h" #include "envoy/config/core/v3/base.pb.h" +#include "envoy/config/health_checker/redis/v2/redis.pb.h" +#include "envoy/config/health_checker/redis/v2/redis.pb.validate.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.h" +#include "envoy/extensions/health_checkers/redis/v3/redis.pb.validate.h" #include "envoy/type/v3/percent.pb.h" #include "common/common/base64.h" @@ -1312,6 +1316,19 @@ TEST_F(ProtobufV2ApiUtilityTest, UnpackToNextVersion) { EXPECT_TRUE(dst.ignore_health_on_host_removal()); } +// MessageUtility::unpackTo() with API message works across version and doesn't register +// deprecations for allowlisted v2 protos. +TEST_F(ProtobufV2ApiUtilityTest, UnpackToNextVersionV2Allowed) { + API_NO_BOOST(envoy::config::health_checker::redis::v2::Redis) source; + source.set_key("foo"); + ProtobufWkt::Any source_any; + source_any.PackFrom(source); + API_NO_BOOST(envoy::extensions::health_checkers::redis::v3::Redis) dst; + MessageUtil::unpackTo(source_any, dst); + EXPECT_EQ(runtime_deprecated_feature_use_.value(), 0); + EXPECT_EQ(dst.key(), "foo"); +} + // Validate warning messages on v2 upgrades. TEST_F(ProtobufV2ApiUtilityTest, V2UpgradeWarningLogs) { API_NO_BOOST(envoy::config::cluster::v3::Cluster) dst; diff --git a/test/common/upstream/BUILD b/test/common/upstream/BUILD index d0d323a12952..53b16647c2a0 100644 --- a/test/common/upstream/BUILD +++ b/test/common/upstream/BUILD @@ -439,7 +439,7 @@ envoy_cc_test( "//test/test_common:simulated_time_system_lib", "//test/test_common:utility_lib", "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", - "@envoy_api//envoy/data/cluster/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/data/cluster/v3:pkg_cc_proto", ], ) diff --git a/test/common/upstream/outlier_detection_impl_test.cc b/test/common/upstream/outlier_detection_impl_test.cc index 1a985ddae542..ce1d26dcf542 100644 --- a/test/common/upstream/outlier_detection_impl_test.cc +++ b/test/common/upstream/outlier_detection_impl_test.cc @@ -6,7 +6,7 @@ #include "envoy/common/time.h" #include "envoy/config/cluster/v3/outlier_detection.pb.h" -#include "envoy/data/cluster/v2alpha/outlier_detection_event.pb.h" +#include "envoy/data/cluster/v3/outlier_detection_event.pb.h" #include "common/network/utility.h" #include "common/upstream/outlier_detection_impl.h" @@ -224,7 +224,7 @@ TEST_F(OutlierDetectorImplTest, DestroyWithActive) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, 500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); EXPECT_EQ(1UL, outlier_detection_ejections_active_.value()); @@ -234,7 +234,7 @@ TEST_F(OutlierDetectorImplTest, DestroyWithActive) { EXPECT_CALL(checker_, check(failover_hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(failover_hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(failover_hosts_[0], 1, 500); EXPECT_TRUE(failover_hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); EXPECT_EQ(2UL, outlier_detection_ejections_active_.value()); @@ -280,7 +280,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlow5xxViaHttpCodes) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, 500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -309,7 +309,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlow5xxViaHttpCodes) { time_system_.setMonotonicTime(std::chrono::milliseconds(40000)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, 500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); EXPECT_EQ(1UL, outlier_detection_ejections_active_.value()); @@ -372,7 +372,7 @@ TEST_F(OutlierDetectorImplTest, ExternalOriginEventsNonSplit) { // Now make sure that EXT_ORIGIN_REQUEST_FAILED ejects the host EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); for (auto i = 0; i < 100; i++) { hosts_[0]->outlierDetector().putResult(Result::ExtOriginRequestFailed); } @@ -400,9 +400,9 @@ TEST_F(OutlierDetectorImplTest, BasicFlow5xxViaNonHttpCodes) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, Result::LocalOriginConnectFailed); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -432,9 +432,9 @@ TEST_F(OutlierDetectorImplTest, BasicFlow5xxViaNonHttpCodes) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, Result::LocalOriginConnectFailed); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); EXPECT_EQ(1UL, outlier_detection_ejections_active_.value()); @@ -479,14 +479,14 @@ TEST_F(OutlierDetectorImplTest, BasicFlowGatewayFailure) { hosts_[0]->outlierDetector().putResponseTime(std::chrono::milliseconds(5)); loadRq(hosts_[0], 2, 503); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)); loadRq(hosts_[0], 2, 503); time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, true)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, true)); loadRq(hosts_[0], 1, 503); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -516,7 +516,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowGatewayFailure) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, true)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, true)); loadRq(hosts_[0], 1, 503); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); EXPECT_EQ(1UL, outlier_detection_ejections_active_.value()); @@ -563,7 +563,7 @@ TEST_F(OutlierDetectorImplTest, TimeoutWithHttpCode) { // Report several LOCAL_ORIGIN_TIMEOUT with optional Http code 500. Host should be ejected. EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); // Get the configured number of failures and simulate than number of connect failures. uint32_t n = runtime_.snapshot_.getInteger(Consecutive5xxRuntime, detector->config().consecutive5xx()); @@ -585,7 +585,7 @@ TEST_F(OutlierDetectorImplTest, TimeoutWithHttpCode) { // Report several LOCAL_ORIGIN_TIMEOUT with HTTP code other that 500. Node should not be ejected. EXPECT_CALL(checker_, check(hosts_[0])).Times(0); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)) + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)) .Times(0); // Get the configured number of failures and simulate than number of connect failures. n = runtime_.snapshot_.getInteger(Consecutive5xxRuntime, detector->config().consecutive5xx()); @@ -599,10 +599,10 @@ TEST_F(OutlierDetectorImplTest, TimeoutWithHttpCode) { // to 5xx code and the node should be ejected. EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)); // Get the configured number of failures and simulate than number of connect failures. n = runtime_.snapshot_.getInteger(ConsecutiveGatewayFailureRuntime, detector->config().consecutiveGatewayFailure()); @@ -630,7 +630,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowLocalOriginFailure) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, true)); + envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, true)); time_system_.setMonotonicTime(std::chrono::milliseconds(0)); // Get the configured number of failures and simulate than number of connect failures. @@ -721,7 +721,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowGatewayFailureAnd5xx) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, true)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, true)); loadRq(hosts_[0], 1, 503); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -752,7 +752,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowGatewayFailureAnd5xx) { time_system_.setMonotonicTime(std::chrono::milliseconds(40000)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, 500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); EXPECT_EQ(1UL, outlier_detection_ejections_active_.value()); @@ -817,10 +817,10 @@ TEST_F(OutlierDetectorImplTest, BasicFlowNonHttpCodesExternalOrigin) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)); EXPECT_CALL(checker_, check(hosts_[0])); loadRq(hosts_[0], 1, Result::LocalOriginConnectFailed); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -851,11 +851,11 @@ TEST_F(OutlierDetectorImplTest, BasicFlowSuccessRateExternalOrigin) { // Expect non-enforcing logging to happen every time the consecutive_5xx_ counter // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)) + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)) .Times(40); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)) .Times(40); // Cause a SR error on one host. First have 4 of the hosts have perfect SR. @@ -865,7 +865,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowSuccessRateExternalOrigin) { time_system_.setMonotonicTime(std::chrono::milliseconds(10000)); EXPECT_CALL(checker_, check(hosts_[4])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), - _, envoy::data::cluster::v2alpha::SUCCESS_RATE, true)); + _, envoy::data::cluster::v3::SUCCESS_RATE, true)); EXPECT_CALL(*interval_timer_, enableTimer(std::chrono::milliseconds(10000), _)); ON_CALL(runtime_.snapshot_, getInteger(SuccessRateStdevFactorRuntime, 1900)) .WillByDefault(Return(1900)); @@ -906,11 +906,11 @@ TEST_F(OutlierDetectorImplTest, BasicFlowSuccessRateExternalOrigin) { // Expect non-enforcing logging to happen every time the consecutive_5xx_ counter // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)) + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)) .Times(5); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)) .Times(5); // Give 4 hosts enough request volume but not to the 5th. Should not cause an ejection. @@ -948,10 +948,10 @@ TEST_F(OutlierDetectorImplTest, ExternalOriginEventsWithSplit) { // Now make sure that EXT_ORIGIN_REQUEST_FAILED ejects the host EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)); for (auto i = 0; i < 100; i++) { hosts_[0]->outlierDetector().putResult(Result::ExtOriginRequestFailed); } @@ -980,7 +980,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowSuccessRateLocalOrigin) { // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) .Times(40); // Cause a SR error on one host. First have 4 of the hosts have perfect SR. loadRq(hosts_, 200, Result::LocalOriginConnectSuccess); @@ -990,7 +990,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowSuccessRateLocalOrigin) { EXPECT_CALL(checker_, check(hosts_[4])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN, true)); + envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN, true)); EXPECT_CALL(*interval_timer_, enableTimer(std::chrono::milliseconds(10000), _)); ON_CALL(runtime_.snapshot_, getInteger(SuccessRateStdevFactorRuntime, 1900)) .WillByDefault(Return(1900)); @@ -1032,7 +1032,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowSuccessRateLocalOrigin) { // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) .Times(5); // Give 4 hosts enough request volume but not to the 5th. Should not cause an ejection. @@ -1096,18 +1096,18 @@ TEST_F(OutlierDetectorImplTest, BasicFlowFailurePercentageExternalOrigin) { // Expect non-enforcing logging to happen every time the consecutive_5xx_ counter // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[3]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)) + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)) .Times(50); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[3]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)) .Times(50); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)) + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)) .Times(60); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)) .Times(60); // Cause a failure percentage error on one host. First 3 hosts have perfect failure percentage; @@ -1120,7 +1120,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowFailurePercentageExternalOrigin) { time_system_.setMonotonicTime(std::chrono::milliseconds(10000)); EXPECT_CALL(checker_, check(hosts_[4])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), - _, envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE, true)); + _, envoy::data::cluster::v3::FAILURE_PERCENTAGE, true)); EXPECT_CALL(*interval_timer_, enableTimer(std::chrono::milliseconds(10000), _)); ON_CALL(runtime_.snapshot_, getInteger(SuccessRateStdevFactorRuntime, 1900)) .WillByDefault(Return(1900)); @@ -1162,11 +1162,11 @@ TEST_F(OutlierDetectorImplTest, BasicFlowFailurePercentageExternalOrigin) { // Expect non-enforcing logging to happen every time the consecutive_5xx_ counter // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)) + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)) .Times(5); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)) .Times(5); // Give 4 hosts enough request volume but not to the 5th. Should not cause an ejection. @@ -1214,7 +1214,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowFailurePercentageLocalOrigin) { // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) .Times(40); // Cause a failure percentage error on one host. First 4 of the hosts have perfect failure // percentage. @@ -1225,10 +1225,10 @@ TEST_F(OutlierDetectorImplTest, BasicFlowFailurePercentageLocalOrigin) { EXPECT_CALL(checker_, check(hosts_[4])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE_LOCAL_ORIGIN, true)); + envoy::data::cluster::v3::FAILURE_PERCENTAGE_LOCAL_ORIGIN, true)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::SUCCESS_RATE_LOCAL_ORIGIN, false)); + envoy::data::cluster::v3::SUCCESS_RATE_LOCAL_ORIGIN, false)); EXPECT_CALL(*interval_timer_, enableTimer(std::chrono::milliseconds(10000), _)); ON_CALL(runtime_.snapshot_, getInteger(FailurePercentageThresholdRuntime, 85)) .WillByDefault(Return(40)); @@ -1270,7 +1270,7 @@ TEST_F(OutlierDetectorImplTest, BasicFlowFailurePercentageLocalOrigin) { // gets saturated (every 5 times). EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[4]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) + envoy::data::cluster::v3::CONSECUTIVE_LOCAL_ORIGIN_FAILURE, false)) .Times(5); // Give 4 hosts enough request volume but not to the 5th. Should not cause an ejection. @@ -1304,7 +1304,7 @@ TEST_F(OutlierDetectorImplTest, RemoveWhileEjected) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, 500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1335,7 +1335,7 @@ TEST_F(OutlierDetectorImplTest, Overflow) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); hosts_[0]->outlierDetector().putHttpResponseCode(500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1360,10 +1360,10 @@ TEST_F(OutlierDetectorImplTest, NotEnforcing) { ON_CALL(runtime_.snapshot_, featureEnabled(EnforcingConsecutive5xxRuntime, 100)) .WillByDefault(Return(false)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, false)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, false)); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), _, - envoy::data::cluster::v2alpha::CONSECUTIVE_GATEWAY_FAILURE, false)); + envoy::data::cluster::v3::CONSECUTIVE_GATEWAY_FAILURE, false)); loadRq(hosts_[0], 1, 503); EXPECT_FALSE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1409,7 +1409,7 @@ TEST_F(OutlierDetectorImplTest, EjectionActiveValueIsAccountedWithoutMetricStora // Since the overflow is not determined by the metric. Host[0] can be ejected. EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); hosts_[0]->outlierDetector().putHttpResponseCode(500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1488,7 +1488,7 @@ TEST_F(OutlierDetectorImplTest, CrossThreadFailRace) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); // Fire the post callback twice. This should only result in a single ejection. post_cb(); @@ -1512,7 +1512,7 @@ TEST_F(OutlierDetectorImplTest, Consecutive_5xxAlreadyEjected) { time_system_.setMonotonicTime(std::chrono::milliseconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 1, 500); EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1547,7 +1547,7 @@ TEST_F(OutlierDetectorImplTest, EjectTimeBackoff) { time_system_.setMonotonicTime(std::chrono::seconds(0)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1568,7 +1568,7 @@ TEST_F(OutlierDetectorImplTest, EjectTimeBackoff) { // Cause ejection again. EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_EQ(1UL, outlier_detection_ejections_active_.value()); @@ -1595,7 +1595,7 @@ TEST_F(OutlierDetectorImplTest, EjectTimeBackoff) { // It should not be brought back until 60 secs from the start of the test. EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1639,7 +1639,7 @@ TEST_F(OutlierDetectorImplTest, EjectTimeBackoff) { // Trigger the next ejection. The node should be ejected for 20 secs. EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1676,7 +1676,7 @@ TEST_F(OutlierDetectorImplTest, EjectTimeBackoff) { time_system_.setMonotonicTime(std::chrono::seconds(610)); EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1725,7 +1725,7 @@ TEST_F(OutlierDetectorImplTest, MaxEjectTime) { for (auto i = 1; i <= 30; i++) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1756,7 +1756,7 @@ TEST_F(OutlierDetectorImplTest, MaxEjectTime) { for (auto i = 1; i < 10; i++) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1814,7 +1814,7 @@ TEST_F(OutlierDetectorImplTest, MaxEjectTimeNotAlligned) { for (auto i = 1; i <= 31; i++) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1845,7 +1845,7 @@ TEST_F(OutlierDetectorImplTest, MaxEjectTimeNotAlligned) { for (auto i = 1; i < 10; i++) { EXPECT_CALL(checker_, check(hosts_[0])); EXPECT_CALL(*event_logger_, logEject(std::static_pointer_cast(hosts_[0]), - _, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true)); + _, envoy::data::cluster::v3::CONSECUTIVE_5XX, true)); loadRq(hosts_[0], 5, 500); // Make sure that node has been ejected. EXPECT_TRUE(hosts_[0]->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)); @@ -1907,7 +1907,7 @@ TEST(OutlierDetectionEventLoggerImplTest, All) { ",\"timestamp\":\"2018-12-18T09:00:00Z\"}\n"))) .WillOnce(SaveArg<0>(&log1)); - event_logger.logEject(host, detector, envoy::data::cluster::v2alpha::CONSECUTIVE_5XX, true); + event_logger.logEject(host, detector, envoy::data::cluster::v3::CONSECUTIVE_5XX, true); Json::Factory::loadFromString(log1); StringViewSaver log2; @@ -1946,7 +1946,7 @@ TEST(OutlierDetectionEventLoggerImplTest, All) { "\"cluster_success_rate_ejection_threshold\":0}," "\"timestamp\":\"2018-12-18T09:00:00Z\",\"secs_since_last_action\":\"30\"}\n"))) .WillOnce(SaveArg<0>(&log3)); - event_logger.logEject(host, detector, envoy::data::cluster::v2alpha::SUCCESS_RATE, false); + event_logger.logEject(host, detector, envoy::data::cluster::v3::SUCCESS_RATE, false); Json::Factory::loadFromString(log3); StringViewSaver log4; @@ -1974,7 +1974,7 @@ TEST(OutlierDetectionEventLoggerImplTest, All) { "\"host_success_rate\":0},\"timestamp\":\"2018-12-18T09:00:00Z\"," "\"secs_since_last_action\":\"30\"}\n"))) .WillOnce(SaveArg<0>(&log5)); - event_logger.logEject(host, detector, envoy::data::cluster::v2alpha::FAILURE_PERCENTAGE, false); + event_logger.logEject(host, detector, envoy::data::cluster::v3::FAILURE_PERCENTAGE, false); Json::Factory::loadFromString(log5); StringViewSaver log6; diff --git a/test/extensions/clusters/aggregate/cluster_integration_test.cc b/test/extensions/clusters/aggregate/cluster_integration_test.cc index 419f4014a2d6..91eeaf9d950a 100644 --- a/test/extensions/clusters/aggregate/cluster_integration_test.cc +++ b/test/extensions/clusters/aggregate/cluster_integration_test.cc @@ -108,7 +108,7 @@ const std::string& config() { retry_priority: name: envoy.retry_priorities.previous_priorities typed_config: - "@type": type.googleapis.com/envoy.config.retry.previous_priorities.PreviousPrioritiesConfig + "@type": type.googleapis.com/envoy.extensions.retry.priority.previous_priorities.v3.PreviousPrioritiesConfig update_frequency: 1 match: prefix: "/aggregatecluster" diff --git a/test/extensions/clusters/redis/BUILD b/test/extensions/clusters/redis/BUILD index 99c5d54c3ecb..47ee1e321d2a 100644 --- a/test/extensions/clusters/redis/BUILD +++ b/test/extensions/clusters/redis/BUILD @@ -45,8 +45,8 @@ envoy_extension_cc_test( "//test/mocks/upstream:health_check_event_logger_mocks", "//test/mocks/upstream:health_checker_mocks", "//test/test_common:utility_lib", - "@envoy_api//envoy/config/cluster/redis:pkg_cc_proto", "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/clusters/redis/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", ], ) @@ -111,7 +111,7 @@ envoy_cc_mock( "//source/common/upstream:cluster_factory_lib", "//source/common/upstream:upstream_lib", "//source/extensions/clusters/redis:redis_cluster", - "@envoy_api//envoy/config/cluster/redis:pkg_cc_proto", + "@envoy_api//envoy/extensions/clusters/redis/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", ], ) diff --git a/test/extensions/clusters/redis/mocks.cc b/test/extensions/clusters/redis/mocks.cc index ad87f8b60d6d..cd8f85e244a4 100644 --- a/test/extensions/clusters/redis/mocks.cc +++ b/test/extensions/clusters/redis/mocks.cc @@ -1,7 +1,7 @@ #include "test/extensions/clusters/redis/mocks.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" diff --git a/test/extensions/clusters/redis/mocks.h b/test/extensions/clusters/redis/mocks.h index b5462372fbdb..96d845268827 100644 --- a/test/extensions/clusters/redis/mocks.h +++ b/test/extensions/clusters/redis/mocks.h @@ -1,5 +1,5 @@ -#include "envoy/config/cluster/redis/redis_cluster.pb.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" #include "envoy/upstream/upstream.h" diff --git a/test/extensions/clusters/redis/redis_cluster_test.cc b/test/extensions/clusters/redis/redis_cluster_test.cc index 3330fde17bf0..2cd77a126330 100644 --- a/test/extensions/clusters/redis/redis_cluster_test.cc +++ b/test/extensions/clusters/redis/redis_cluster_test.cc @@ -3,9 +3,9 @@ #include #include -#include "envoy/config/cluster/redis/redis_cluster.pb.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h" #include "envoy/config/cluster/v3/cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" #include "envoy/stats/scope.h" @@ -107,15 +107,15 @@ class RedisClusterTest : public testing::Test, admin_, ssl_context_manager_, *scope, cm, local_info_, dispatcher_, stats_store_, singleton_manager_, tls_, validation_visitor_, *api_); - envoy::config::cluster::redis::RedisClusterConfig config; + envoy::extensions::clusters::redis::v3::RedisClusterConfig config; Config::Utility::translateOpaqueConfig(cluster_config.cluster_type().typed_config(), ProtobufWkt::Struct::default_instance(), ProtobufMessage::getStrictValidationVisitor(), config); cluster_callback_ = std::make_shared>(); cluster_ = std::make_shared( cluster_config, - TestUtility::downcastAndValidate( - config), + TestUtility::downcastAndValidate< + const envoy::extensions::clusters::redis::v3::RedisClusterConfig&>(config), *this, cm, runtime_, *api_, dns_resolver_, factory_context, std::move(scope), false, cluster_callback_); // This allows us to create expectation on cluster slot response without waiting for @@ -137,7 +137,7 @@ class RedisClusterTest : public testing::Test, admin_, ssl_context_manager_, *scope, cm, local_info_, dispatcher_, stats_store_, singleton_manager_, tls_, validation_visitor_, *api_); - envoy::config::cluster::redis::RedisClusterConfig config; + envoy::extensions::clusters::redis::v3::RedisClusterConfig config; Config::Utility::translateOpaqueConfig(cluster_config.cluster_type().typed_config(), ProtobufWkt::Struct::default_instance(), validation_visitor_, config); diff --git a/test/extensions/filters/network/redis_proxy/BUILD b/test/extensions/filters/network/redis_proxy/BUILD index 79e3d11e1969..9cf1780ead6d 100644 --- a/test/extensions/filters/network/redis_proxy/BUILD +++ b/test/extensions/filters/network/redis_proxy/BUILD @@ -63,8 +63,8 @@ envoy_extension_cc_test( "//test/mocks/upstream:host_mocks", "//test/mocks/upstream:host_set_mocks", "//test/mocks/upstream:thread_local_cluster_mocks", - "@envoy_api//envoy/config/cluster/redis:pkg_cc_proto", "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/clusters/redis/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto", ], ) diff --git a/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc b/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc index 1211390c625d..45405cb286d7 100644 --- a/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc +++ b/test/extensions/filters/network/redis_proxy/conn_pool_impl_test.cc @@ -1,8 +1,8 @@ #include -#include "envoy/config/cluster/redis/redis_cluster.pb.h" -#include "envoy/config/cluster/redis/redis_cluster.pb.validate.h" #include "envoy/config/cluster/v3/cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.h" +#include "envoy/extensions/clusters/redis/v3/redis_cluster.pb.validate.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.h" #include "envoy/extensions/filters/network/redis_proxy/v3/redis_proxy.pb.validate.h" diff --git a/test/extensions/health_checkers/redis/config_test.cc b/test/extensions/health_checkers/redis/config_test.cc index 5f4caf4a4f66..e248faebf51a 100644 --- a/test/extensions/health_checkers/redis/config_test.cc +++ b/test/extensions/health_checkers/redis/config_test.cc @@ -58,7 +58,7 @@ TEST(HealthCheckerFactoryTest, CreateRedis) { custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis key: foo )EOF"; @@ -107,7 +107,7 @@ TEST(HealthCheckerFactoryTest, CreateRedisWithoutKey) { custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis )EOF"; NiceMock context; @@ -131,7 +131,7 @@ TEST(HealthCheckerFactoryTest, CreateRedisWithLogHCFailure) { custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis always_log_health_check_failures: true )EOF"; @@ -156,7 +156,7 @@ TEST(HealthCheckerFactoryTest, CreateRedisViaUpstreamHealthCheckerFactory) { custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis key: foo )EOF"; diff --git a/test/extensions/health_checkers/redis/redis_test.cc b/test/extensions/health_checkers/redis/redis_test.cc index 62fbf4395ba5..f1beb870b581 100644 --- a/test/extensions/health_checkers/redis/redis_test.cc +++ b/test/extensions/health_checkers/redis/redis_test.cc @@ -53,7 +53,7 @@ class RedisHealthCheckerTest custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis )EOF"; const auto& health_check_config = Upstream::parseHealthCheckFromV3Yaml(yaml); @@ -76,7 +76,7 @@ class RedisHealthCheckerTest custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis )EOF"; const auto& health_check_config = Upstream::parseHealthCheckFromV2Yaml(yaml); @@ -113,7 +113,7 @@ class RedisHealthCheckerTest custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis )EOF"; const auto& health_check_config = Upstream::parseHealthCheckFromV3Yaml(yaml); @@ -136,7 +136,7 @@ class RedisHealthCheckerTest custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis key: foo )EOF"; @@ -160,7 +160,7 @@ class RedisHealthCheckerTest custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis key: foo )EOF"; @@ -221,7 +221,7 @@ class RedisHealthCheckerTest custom_health_check: name: redis typed_config: - "@type": type.googleapis.com/envoy.config.health_checker.redis.v2.Redis + "@type": type.googleapis.com/envoy.extensions.health_checkers.redis.v3.Redis )EOF"; const auto& health_check_config = Upstream::parseHealthCheckFromV3Yaml(yaml); diff --git a/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc b/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc index 40a5997fbe9e..f944e7de2dcf 100644 --- a/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc +++ b/test/extensions/quic_listeners/quiche/integration/quic_http_integration_test.cc @@ -189,11 +189,11 @@ class QuicHttpIntegrationTest : public HttpIntegrationTest, public QuicMultiVers resource_monitors: - name: "envoy.resource_monitors.injected_resource_1" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.injected_resource.v3.InjectedResourceConfig filename: "{}" - name: "envoy.resource_monitors.injected_resource_2" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.injected_resource.v3.InjectedResourceConfig filename: "{}" actions: - name: "envoy.overload_actions.stop_accepting_requests" diff --git a/test/extensions/resource_monitors/fixed_heap/BUILD b/test/extensions/resource_monitors/fixed_heap/BUILD index 2d28542abde3..69b9054e0f39 100644 --- a/test/extensions/resource_monitors/fixed_heap/BUILD +++ b/test/extensions/resource_monitors/fixed_heap/BUILD @@ -18,7 +18,7 @@ envoy_extension_cc_test( external_deps = ["abseil_optional"], deps = [ "//source/extensions/resource_monitors/fixed_heap:fixed_heap_monitor", - "@envoy_api//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/fixed_heap/v3:pkg_cc_proto", ], ) @@ -32,6 +32,6 @@ envoy_extension_cc_test( "//source/extensions/resource_monitors/fixed_heap:config", "//source/server:resource_monitor_config_lib", "//test/mocks/event:event_mocks", - "@envoy_api//envoy/config/resource_monitor/fixed_heap/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/fixed_heap/v3:pkg_cc_proto", ], ) diff --git a/test/extensions/resource_monitors/fixed_heap/config_test.cc b/test/extensions/resource_monitors/fixed_heap/config_test.cc index 07249bcfe841..14d131dd4c82 100644 --- a/test/extensions/resource_monitors/fixed_heap/config_test.cc +++ b/test/extensions/resource_monitors/fixed_heap/config_test.cc @@ -1,5 +1,5 @@ -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.h" -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.validate.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.validate.h" #include "envoy/registry/registry.h" #include "server/resource_monitor_config_impl.h" @@ -22,7 +22,7 @@ TEST(FixedHeapMonitorFactoryTest, CreateMonitor) { "envoy.resource_monitors.fixed_heap"); EXPECT_NE(factory, nullptr); - envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig config; + envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig config; config.set_max_heap_size_bytes(std::numeric_limits::max()); Event::MockDispatcher dispatcher; Api::ApiPtr api = Api::createApiForTest(); diff --git a/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc b/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc index 905f083e15aa..1d5eb84c22c8 100644 --- a/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc +++ b/test/extensions/resource_monitors/fixed_heap/fixed_heap_monitor_test.cc @@ -1,4 +1,4 @@ -#include "envoy/config/resource_monitor/fixed_heap/v2alpha/fixed_heap.pb.h" +#include "envoy/extensions/resource_monitors/fixed_heap/v3/fixed_heap.pb.h" #include "extensions/resource_monitors/fixed_heap/fixed_heap_monitor.h" @@ -39,7 +39,7 @@ class ResourcePressure : public Server::ResourceMonitor::Callbacks { }; TEST(FixedHeapMonitorTest, ComputesCorrectUsage) { - envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig config; + envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig config; config.set_max_heap_size_bytes(1000); auto stats_reader = std::make_unique(); EXPECT_CALL(*stats_reader, reservedHeapBytes()).WillOnce(testing::Return(800)); @@ -54,7 +54,7 @@ TEST(FixedHeapMonitorTest, ComputesCorrectUsage) { } TEST(FixedHeapMonitorTest, ComputeUsageWithRealMemoryStats) { - envoy::config::resource_monitor::fixed_heap::v2alpha::FixedHeapConfig config; + envoy::extensions::resource_monitors::fixed_heap::v3::FixedHeapConfig config; uint64_t max_heap = 1024 * 1024 * 1024; config.set_max_heap_size_bytes(max_heap); auto stats_reader = std::make_unique(); diff --git a/test/extensions/resource_monitors/injected_resource/BUILD b/test/extensions/resource_monitors/injected_resource/BUILD index 6ba031f7b85f..34646b86bd76 100644 --- a/test/extensions/resource_monitors/injected_resource/BUILD +++ b/test/extensions/resource_monitors/injected_resource/BUILD @@ -22,7 +22,7 @@ envoy_cc_test( "//source/server:resource_monitor_config_lib", "//test/test_common:environment_lib", "//test/test_common:utility_lib", - "@envoy_api//envoy/config/resource_monitor/injected_resource/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/injected_resource/v3:pkg_cc_proto", ], ) @@ -37,6 +37,6 @@ envoy_extension_cc_test( "//source/extensions/resource_monitors/injected_resource:config", "//source/server:resource_monitor_config_lib", "//test/test_common:environment_lib", - "@envoy_api//envoy/config/resource_monitor/injected_resource/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/extensions/resource_monitors/injected_resource/v3:pkg_cc_proto", ], ) diff --git a/test/extensions/resource_monitors/injected_resource/config_test.cc b/test/extensions/resource_monitors/injected_resource/config_test.cc index 833b37c2bb38..c5cd8eca4de5 100644 --- a/test/extensions/resource_monitors/injected_resource/config_test.cc +++ b/test/extensions/resource_monitors/injected_resource/config_test.cc @@ -1,5 +1,5 @@ -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.h" -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.validate.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.validate.h" #include "envoy/registry/registry.h" #include "common/event/dispatcher_impl.h" @@ -25,7 +25,7 @@ TEST(InjectedResourceMonitorFactoryTest, CreateMonitor) { "envoy.resource_monitors.injected_resource"); ASSERT_NE(factory, nullptr); - envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig config; + envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig config; config.set_filename(TestEnvironment::temporaryPath("injected_resource")); Api::ApiPtr api = Api::createApiForTest(); Event::DispatcherPtr dispatcher(api->allocateDispatcher("test_thread")); diff --git a/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc b/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc index e1a20bd147d4..ac5ddb860c4e 100644 --- a/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc +++ b/test/extensions/resource_monitors/injected_resource/injected_resource_monitor_test.cc @@ -1,4 +1,4 @@ -#include "envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.h" +#include "envoy/extensions/resource_monitors/injected_resource/v3/injected_resource.pb.h" #include "common/event/dispatcher_impl.h" #include "common/stats/isolated_store_impl.h" @@ -24,7 +24,7 @@ namespace { class TestableInjectedResourceMonitor : public InjectedResourceMonitor { public: TestableInjectedResourceMonitor( - const envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig& + const envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig& config, Server::Configuration::ResourceMonitorFactoryContext& context) : InjectedResourceMonitor(config, context), dispatcher_(context.dispatcher()) {} @@ -61,7 +61,7 @@ class InjectedResourceMonitorTest : public testing::Test { void updateResource(double pressure) { updateResource(absl::StrCat(pressure)); } std::unique_ptr createMonitor() { - envoy::config::resource_monitor::injected_resource::v2alpha::InjectedResourceConfig config; + envoy::extensions::resource_monitors::injected_resource::v3::InjectedResourceConfig config; config.set_filename(resource_filename_); Server::Configuration::ResourceMonitorFactoryContextImpl context( *dispatcher_, *api_, ProtobufMessage::getStrictValidationVisitor()); diff --git a/test/extensions/retry/host/omit_canary_hosts/config_test.cc b/test/extensions/retry/host/omit_canary_hosts/config_test.cc index d6e7d33e19b7..ad08812c9795 100644 --- a/test/extensions/retry/host/omit_canary_hosts/config_test.cc +++ b/test/extensions/retry/host/omit_canary_hosts/config_test.cc @@ -43,7 +43,8 @@ TEST(OmitCanaryHostsRetryPredicateTest, EmptyConfig) { ASSERT_NE(nullptr, factory); ProtobufTypes::MessagePtr config = factory->createEmptyConfigProto(); - EXPECT_TRUE(dynamic_cast( + EXPECT_TRUE(dynamic_cast< + envoy::extensions::retry::host::omit_canary_hosts::v3::OmitCanaryHostsPredicate*>( config.get())); } diff --git a/test/extensions/retry/host/previous_hosts/config_test.cc b/test/extensions/retry/host/previous_hosts/config_test.cc index 3b1b28b70bff..a706e2665489 100644 --- a/test/extensions/retry/host/previous_hosts/config_test.cc +++ b/test/extensions/retry/host/previous_hosts/config_test.cc @@ -56,8 +56,9 @@ TEST(PreviousHostsRetryPredicateConfigTest, EmptyConfig) { ASSERT_NE(nullptr, factory); ProtobufTypes::MessagePtr config = factory->createEmptyConfigProto(); - EXPECT_TRUE(dynamic_cast( - config.get())); + EXPECT_TRUE( + dynamic_cast( + config.get())); } } // namespace diff --git a/test/extensions/retry/priority/previous_priorities/BUILD b/test/extensions/retry/priority/previous_priorities/BUILD index 0fa5ed49608d..cc5af8f0a7f8 100644 --- a/test/extensions/retry/priority/previous_priorities/BUILD +++ b/test/extensions/retry/priority/previous_priorities/BUILD @@ -22,6 +22,6 @@ envoy_extension_cc_test( "//test/mocks/upstream:host_mocks", "//test/mocks/upstream:host_set_mocks", "//test/mocks/upstream:priority_set_mocks", - "@envoy_api//envoy/config/retry/previous_priorities:pkg_cc_proto", + "@envoy_api//envoy/extensions/retry/priority/previous_priorities/v3:pkg_cc_proto", ], ) diff --git a/test/extensions/retry/priority/previous_priorities/config_test.cc b/test/extensions/retry/priority/previous_priorities/config_test.cc index 5647f4fcfd75..3d46262e926b 100644 --- a/test/extensions/retry/priority/previous_priorities/config_test.cc +++ b/test/extensions/retry/priority/previous_priorities/config_test.cc @@ -1,4 +1,4 @@ -#include "envoy/config/retry/previous_priorities/previous_priorities_config.pb.h" +#include "envoy/extensions/retry/priority/previous_priorities/v3/previous_priorities_config.pb.h" #include "envoy/registry/registry.h" #include "envoy/upstream/retry.h" @@ -30,7 +30,7 @@ class RetryPriorityTest : public testing::Test { auto factory = Registry::FactoryRegistry::getFactory( RetryPriorityValues::get().PreviousPrioritiesRetryPriority); - envoy::config::retry::previous_priorities::PreviousPrioritiesConfig config; + envoy::extensions::retry::priority::previous_priorities::v3::PreviousPrioritiesConfig config; config.set_update_frequency(update_frequency_); // Use createEmptyConfigProto to exercise that code path. This ensures the proto returned // by that method is compatible with the downcast in createRetryPriority. diff --git a/test/mocks/upstream/BUILD b/test/mocks/upstream/BUILD index a6d849e474c4..5ab7a4d10109 100644 --- a/test/mocks/upstream/BUILD +++ b/test/mocks/upstream/BUILD @@ -41,7 +41,7 @@ envoy_cc_mock( "//source/common/network:utility_lib", "//test/mocks/network:transport_socket_mocks", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", - "@envoy_api//envoy/data/cluster/v2alpha:pkg_cc_proto", + "@envoy_api//envoy/data/cluster/v3:pkg_cc_proto", ], ) diff --git a/test/mocks/upstream/host.h b/test/mocks/upstream/host.h index f5e81da11ac2..3e54b891fe49 100644 --- a/test/mocks/upstream/host.h +++ b/test/mocks/upstream/host.h @@ -6,7 +6,7 @@ #include #include "envoy/config/core/v3/base.pb.h" -#include "envoy/data/cluster/v2alpha/outlier_detection_event.pb.h" +#include "envoy/data/cluster/v3/outlier_detection_event.pb.h" #include "envoy/upstream/upstream.h" #include "common/stats/symbol_table_impl.h" @@ -44,7 +44,7 @@ class MockEventLogger : public EventLogger { MOCK_METHOD(void, logEject, (const HostDescriptionConstSharedPtr& host, Detector& detector, - envoy::data::cluster::v2alpha::OutlierEjectionType type, bool enforced)); + envoy::data::cluster::v3::OutlierEjectionType type, bool enforced)); MOCK_METHOD(void, logUneject, (const HostDescriptionConstSharedPtr& host)); }; diff --git a/tools/type_whisperer/proto_build_targets_gen.py b/tools/type_whisperer/proto_build_targets_gen.py index 8dabc687c973..2cff42a56fee 100644 --- a/tools/type_whisperer/proto_build_targets_gen.py +++ b/tools/type_whisperer/proto_build_targets_gen.py @@ -23,6 +23,18 @@ V3_REGEX = re.compile(r'envoy[\w\.]*\.(v3alpha|v3)') +# We didn't upgrade these as v2/v3 were the same, but later on decided that +# we would upgrade. We need to preseve both v2/v3 variants for now in the v3 +# API. +ACCIDENTAL_V3_PKGS = [ + 'envoy.config.filter.thrift.router.v2alpha1', + 'envoy.config.health_checker.redis.v2', + 'envoy.config.resource_monitor.fixed_heap.v2alpha', + 'envoy.config.resource_monitor.injected_resource.v2alpha', + 'envoy.config.retry.omit_canary_hosts.v2', + 'envoy.config.retry.previous_hosts.v2', +] + API_BUILD_FILE_TEMPLATE = string.Template( """# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. @@ -90,6 +102,10 @@ def IsV2Package(pkg): return False +def AccidentalV3Package(pkg): + return pkg in ACCIDENTAL_V3_PKGS + + def IsV3Package(pkg): return V3_REGEX.match(pkg) is not None @@ -108,7 +124,7 @@ def IsV3Package(pkg): if IsV2Package(pkg): v2_packages.add(pkg) # Special case for v2 packages that are part of v3 (still active) - if not desc.next_version_type_name: + if AccidentalV3Package(pkg): v3_packages.add(pkg) # Generate BUILD file. build_file_contents = API_BUILD_FILE_TEMPLATE.substitute(v2_deps=DepsFormat(v2_packages), From df41345f39a92c98818dc01b42df7a5a3e84ed4a Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Wed, 3 Feb 2021 02:01:56 +0000 Subject: [PATCH 2/3] Typo. Signed-off-by: Harvey Tuch --- source/common/protobuf/utility.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/protobuf/utility.cc b/source/common/protobuf/utility.cc index d76443203949..94fe3dc3d44c 100644 --- a/source/common/protobuf/utility.cc +++ b/source/common/protobuf/utility.cc @@ -28,7 +28,7 @@ namespace Envoy { namespace { // For historical reasons, these v2 protos are allowed in v3 and will not be removed during the v2 -// turndown. +// turn down. static const absl::flat_hash_set& v2ProtosAllowedInV3() { CONSTRUCT_ON_FIRST_USE( absl::flat_hash_set, From 77f4596c7193550b99b8f6c98ef92717f5c82411 Mon Sep 17 00:00:00 2001 From: Harvey Tuch Date: Wed, 10 Feb 2021 03:42:54 +0000 Subject: [PATCH 3/3] Update some configs/docs refs. Signed-off-by: Harvey Tuch --- configs/google-vrp/envoy-edge.yaml | 2 +- configs/google-vrp/envoy-origin.yaml | 2 +- docs/protodoc_manifest.yaml | 2 +- docs/root/configuration/best_practices/_include/edge.yaml | 2 +- .../operations/overload_manager/overload_manager.rst | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configs/google-vrp/envoy-edge.yaml b/configs/google-vrp/envoy-edge.yaml index fc95700f115c..466304dc125e 100644 --- a/configs/google-vrp/envoy-edge.yaml +++ b/configs/google-vrp/envoy-edge.yaml @@ -3,7 +3,7 @@ overload_manager: resource_monitors: - name: "envoy.resource_monitors.fixed_heap" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.fixed_heap.v3.FixedHeapConfig # TODO: Tune for your system. max_heap_size_bytes: 1073741824 # 1 GiB actions: diff --git a/configs/google-vrp/envoy-origin.yaml b/configs/google-vrp/envoy-origin.yaml index 283d347e5a27..a9421fee5ab9 100644 --- a/configs/google-vrp/envoy-origin.yaml +++ b/configs/google-vrp/envoy-origin.yaml @@ -3,7 +3,7 @@ overload_manager: resource_monitors: - name: "envoy.resource_monitors.fixed_heap" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.fixed_heap.v3.FixedHeapConfig max_heap_size_bytes: 1073741824 # 1 GiB actions: - name: "envoy.overload_actions.shrink_heap" diff --git a/docs/protodoc_manifest.yaml b/docs/protodoc_manifest.yaml index ecdf19115a34..cffe486ea174 100644 --- a/docs/protodoc_manifest.yaml +++ b/docs/protodoc_manifest.yaml @@ -6,7 +6,7 @@ fields: resource_monitors: - name: "envoy.resource_monitors.fixed_heap" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.fixed_heap.v3.FixedHeapConfig max_heap_size_bytes: 1073741824 actions: - name: "envoy.overload_actions.shrink_heap" diff --git a/docs/root/configuration/best_practices/_include/edge.yaml b/docs/root/configuration/best_practices/_include/edge.yaml index 21a6b7e7a5c1..18cfaa286edb 100644 --- a/docs/root/configuration/best_practices/_include/edge.yaml +++ b/docs/root/configuration/best_practices/_include/edge.yaml @@ -3,7 +3,7 @@ overload_manager: resource_monitors: - name: "envoy.resource_monitors.fixed_heap" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.fixed_heap.v3.FixedHeapConfig # TODO: Tune for your system. max_heap_size_bytes: 2147483648 # 2 GiB actions: diff --git a/docs/root/configuration/operations/overload_manager/overload_manager.rst b/docs/root/configuration/operations/overload_manager/overload_manager.rst index 089a56276012..3a80915ed0d9 100644 --- a/docs/root/configuration/operations/overload_manager/overload_manager.rst +++ b/docs/root/configuration/operations/overload_manager/overload_manager.rst @@ -19,7 +19,7 @@ requests when heap memory usage reaches 99%. resource_monitors: - name: "envoy.resource_monitors.fixed_heap" typed_config: - "@type": type.googleapis.com/envoy.config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig + "@type": type.googleapis.com/envoy.extensions.resource_monitors.fixed_heap.v3.FixedHeapConfig max_heap_size_bytes: 2147483648 actions: - name: "envoy.overload_actions.disable_http_keepalive"