-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor dns cluster api #36353
Refactor dns cluster api #36353
Changes from 31 commits
9048a69
3917c63
dab5712
fd255d0
c944d7e
8ed51ae
8915b81
2464e2c
821bb34
1d54cff
58dbf1f
9784406
7309f8d
69f9cec
5420879
a9a5a5c
6da56ce
16f9cc1
d4a0058
9586603
8a5b9f6
676a8ba
bdc8883
64a6fbd
52647e3
9fe2bb2
3dc3fb1
1c319dc
2e7d6e5
c22edc1
31b9024
c348f70
cea08c9
cb2d8fb
199bbb1
c0607d3
05fd078
684ca7a
6c36802
0463313
39545a4
727cf77
5232706
df92eef
82ae4ce
e8bd59a
752a805
bd0ae97
1ffdf41
aeb3302
0b816c6
2a7832f
9b7927c
3078d7c
e31a09b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -953,8 +953,13 @@ message Cluster { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// and :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// this setting is ignored. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
google.protobuf.Duration dns_refresh_rate = 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[(validate.rules).duration = {gt {nanos: 1000000}}]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// This field is deprecated in favor of :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// will be ignored if :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` is set. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
google.protobuf.Duration dns_refresh_rate = 16 [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these fields still need to be used for other cluster types, like redis? If so, we probably can't mark them as deprecated yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both redis and dynamic forward proxies define their own refresh rates envoy/api/envoy/extensions/clusters/redis/v3/redis_cluster.proto Lines 58 to 85 in 983545f
Couldn't find any other ones. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
deprecated = true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(validate.rules).duration = {gt {nanos: 1000000}}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(envoy.annotations.deprecated_at_minor_version) = "3.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// DNS jitter can be optionally specified if the cluster type is either | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -965,7 +970,13 @@ message Cluster { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// and :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// this setting is ignored. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
google.protobuf.Duration dns_jitter = 58 [(validate.rules).duration = {gte {}}]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// This field is deprecated in favor of :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// will be ignored if :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` is set. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
google.protobuf.Duration dns_jitter = 58 [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
deprecated = true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(validate.rules).duration = {gte {}}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(envoy.annotations.deprecated_at_minor_version) = "3.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// If the DNS failure refresh rate is specified and the cluster type is either | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -975,16 +986,28 @@ message Cluster { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// other than :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>` and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` this setting is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// ignored. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RefreshRate dns_failure_refresh_rate = 44; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// This field is deprecated in favor of :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// will be ignored if :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` is set. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RefreshRate dns_failure_refresh_rate = 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Optional configuration for setting cluster's DNS refresh rate. If the value is set to true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// cluster's DNS refresh rate will be set to resource record's TTL which comes from DNS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// resolution. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool respect_dns_ttl = 39; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// This field is deprecated in favor of :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// will be ignored if :ref:`cluster_type<envoy_v3_api_field_config.cluster.v3.Cluster.cluster_type>` is set. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool respect_dns_ttl = 39 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// The DNS IP address resolution policy. If this setting is not specified, the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// value defaults to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`AUTO<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DnsLookupFamily.AUTO>`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Note that this field is deprecated for cluster types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// and :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` cluster. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// and will be ignored if ``config_type.name`` is ``envoy.cluster.dns``, ``envoy.cluster.logical_dns``, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// ``envoy.cluster.strict_dns``. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Use :ref:`config_type<envoy_v3_api_field_extensions.clusters.dns.v3.DnsCluster.config_type>` instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DnsLookupFamily dns_lookup_family = 17 [(validate.rules).enum = {defined_only: true}]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// If DNS resolvers are specified and the cluster type is either | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -1024,6 +1047,12 @@ message Cluster { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// During the transition period when both ``dns_resolution_config`` and ``typed_dns_resolver_config`` exists, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// when ``typed_dns_resolver_config`` is in place, Envoy will use it and ignore ``dns_resolution_config``. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// When ``typed_dns_resolver_config`` is missing, the default behavior is in place. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Also note that this field is deprecated for cluster types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// :ref:`STRICT_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// and :ref:`LOGICAL_DNS<envoy_v3_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` cluster. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// and will be ignored if ``config_type.name`` is ``envoy.cluster.dns``, ``envoy.cluster.logical_dns``, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// ``envoy.cluster.strict_dns``. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Use :ref:`config_type<envoy_v3_api_field_extensions.clusters.dns.v3.DnsCluster.config_type>` instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// [#extension-category: envoy.network.dns_resolver] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
core.v3.TypedExtensionConfig typed_dns_resolver_config = 55; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 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 = ["@com_github_cncf_xds//udpa/annotations:pkg"], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.extensions.clusters.common.dns.v3; | ||
|
||
import "udpa/annotations/status.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.extensions.clusters.common.dns.v3"; | ||
option java_outer_classname = "DnsProto"; | ||
option java_multiple_files = true; | ||
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/common/dns/v3;dnsv3"; | ||
option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
||
enum DnsLookupFamily { | ||
Stevenjin8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
UNSPECIFIED = 0; | ||
AUTO = 1; | ||
V4_ONLY = 2; | ||
V6_ONLY = 3; | ||
V4_PREFERRED = 4; | ||
ALL = 5; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 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/core/v3:pkg", | ||
"//envoy/extensions/clusters/common/dns/v3:pkg", | ||
"@com_github_cncf_xds//udpa/annotations:pkg", | ||
], | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.extensions.clusters.dns.v3; | ||
|
||
import "envoy/config/core/v3/extension.proto"; | ||
import "envoy/extensions/clusters/common/dns/v3/dns.proto"; | ||
|
||
import "google/protobuf/duration.proto"; | ||
|
||
import "udpa/annotations/status.proto"; | ||
import "validate/validate.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.extensions.clusters.dns.v3"; | ||
option java_outer_classname = "DnsClusterProto"; | ||
option java_multiple_files = true; | ||
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/clusters/dns/v3;dnsv3"; | ||
option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
||
// [#protodoc-title: DNS cluster configuration] | ||
|
||
// Configuration for strict and logical DNS clusters. | ||
// [#extension: envoy.clusters.strict_dns] | ||
// [#extension: envoy.clusters.logical_dns] | ||
|
||
// [#next-free-field: 10] | ||
message DnsCluster { | ||
Stevenjin8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
enum DnsDiscoveryType { | ||
LOGICAL = 0; | ||
STRICT = 1; | ||
} | ||
|
||
message RefreshRate { | ||
// Specifies the base interval between refreshes. This parameter is required and must be greater | ||
// than zero and less than | ||
// :ref:`max_interval <envoy_v3_api_field_extensions.clusters.dns.v3.DnsCluster.RefreshRate.max_interval>`. | ||
google.protobuf.Duration base_interval = 1 [(validate.rules).duration = { | ||
required: true | ||
gt {nanos: 1000000} | ||
}]; | ||
|
||
// Specifies the maximum interval between refreshes. This parameter is optional, but must be | ||
// greater than or equal to the | ||
// :ref:`base_interval <envoy_v3_api_field_extensions.clusters.dns.v3.DnsCluster.RefreshRate.base_interval>` if set. The default | ||
// is 10 times the :ref:`base_interval <envoy_v3_api_field_extensions.clusters.dns.v3.DnsCluster.RefreshRate.base_interval>`. | ||
google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {nanos: 1000000}}]; | ||
} | ||
|
||
// This value is the cluster’s DNS refresh rate. The value configured must be at least 1ms. | ||
// If this setting is not specified, the | ||
// value defaults to 5000ms. | ||
google.protobuf.Duration dns_refresh_rate = 3 [(validate.rules).duration = {gt {nanos: 1000000}}]; | ||
Stevenjin8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// This is the cluster’s DNS refresh rate when requests are failing. If this setting is | ||
// not specified, the failure refresh rate defaults to the DNS refresh rate. | ||
RefreshRate dns_failure_refresh_rate = 4; | ||
|
||
// Optional configuration for setting cluster's DNS refresh rate. If the value is set to true, | ||
// cluster's DNS refresh rate will be set to resource record's TTL which comes from DNS | ||
// resolution. | ||
bool respect_dns_ttl = 5; | ||
|
||
// DNS jitter causes the cluster to refresh DNS entries later by a random amount of time to avoid a | ||
// stampede of DNS requests. This value sets the upper bound (exclusive) for the random amount. | ||
// There will be no jitter if this value is omitted. | ||
google.protobuf.Duration dns_jitter = 6 [(validate.rules).duration = {gte {}}]; | ||
|
||
// DNS resolver type configuration extension. This extension can be used to configure c-ares, apple, | ||
// or any other DNS resolver types and the related parameters. | ||
// For example, an object of | ||
// :ref:`CaresDnsResolverConfig <envoy_v3_api_msg_extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig>` | ||
// can be packed into this ``typed_dns_resolver_config``. This configuration replaces the | ||
// :ref:`Cluster.dns_resolution_config <envoy_v3_api_field_config.cluster.v3.Cluster.typed_dns_resolution_config>` | ||
// configuration which replaces `Cluster.dns_resolution_config <envoy_v3_api_field_config.cluster.v3.Cluster.dns_resolution_config>`. | ||
// During the transition period when ``DnsCluster.typed_dns_resolver_config``, ``Cluster.dns_resolution_config``, and | ||
// ``Cluster.typed_dns_resolver_config`` exists, Envoy will prefer, ``DnsCluster.typed_dns_resolver_config`` over | ||
// ``Cluster.typed_dns_resolver_config`` over ``cluster.dns_resolver_config``. | ||
// [#extension-category: envoy.network.dns_resolver] | ||
config.core.v3.TypedExtensionConfig typed_dns_resolver_config = 7; | ||
|
||
// The DNS IP address resolution policy. If this setting is not specified, the | ||
// value defaults to | ||
// :ref:`AUTO<envoy_v3_api_enum_value_extensions.clusters.dns.v3.DnsCluster.DnsLookupFamily.AUTO>`. | ||
common.dns.v3.DnsLookupFamily dns_lookup_family = 8; | ||
|
||
// Whether to do logical or strict dns resolution. | ||
// This field is only considered when the ``name`` field of the ``TypedConfig`` is ``envoy.cluster.dns``. | ||
DnsDiscoveryType dns_discovery_type = 9; | ||
Stevenjin8 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#include "source/extensions/clusters/common/dns_cluster_backcompat.h" | ||
|
||
#include "envoy/common/exception.h" | ||
#include "envoy/config/cluster/v3/cluster.pb.h" | ||
#include "envoy/extensions/clusters/dns/v3/dns_cluster.pb.h" | ||
|
||
namespace Envoy { | ||
namespace Upstream { | ||
|
||
void createDnsClusterFromLegacyFields( | ||
const envoy::config::cluster::v3::Cluster& cluster, | ||
envoy::extensions::clusters::dns::v3::DnsCluster& dns_cluster) { | ||
|
||
// We have to add all these guards because otherwise dns_cluster.mutable_FIELD will initialize the | ||
// field and dns_cluster.has_FIELD will return true | ||
if (cluster.has_dns_refresh_rate()) { | ||
dns_cluster.mutable_dns_refresh_rate()->CopyFrom(cluster.dns_refresh_rate()); | ||
} | ||
|
||
if (cluster.has_dns_failure_refresh_rate()) { | ||
auto* new_refresh_rate = dns_cluster.mutable_dns_failure_refresh_rate(); | ||
const auto& old_refresh_rate = cluster.dns_failure_refresh_rate(); | ||
|
||
if (old_refresh_rate.has_max_interval()) { | ||
new_refresh_rate->mutable_max_interval()->CopyFrom(old_refresh_rate.max_interval()); | ||
} | ||
if (old_refresh_rate.has_base_interval()) { | ||
new_refresh_rate->mutable_base_interval()->CopyFrom(old_refresh_rate.base_interval()); | ||
} | ||
} | ||
|
||
dns_cluster.set_respect_dns_ttl(cluster.respect_dns_ttl()); | ||
|
||
if (cluster.has_dns_jitter()) { | ||
dns_cluster.mutable_dns_jitter()->CopyFrom(cluster.dns_jitter()); | ||
} | ||
|
||
switch (cluster.dns_lookup_family()) { | ||
PANIC_ON_PROTO_ENUM_SENTINEL_VALUES; | ||
case envoy::config::cluster::v3::Cluster::AUTO: | ||
dns_cluster.set_dns_lookup_family(envoy::extensions::clusters::common::dns::v3::AUTO); | ||
break; | ||
case envoy::config::cluster::v3::Cluster::V4_ONLY: | ||
dns_cluster.set_dns_lookup_family(envoy::extensions::clusters::common::dns::v3::V4_ONLY); | ||
break; | ||
case envoy::config::cluster::v3::Cluster::V6_ONLY: | ||
dns_cluster.set_dns_lookup_family(envoy::extensions::clusters::common::dns::v3::V6_ONLY); | ||
break; | ||
case envoy::config::cluster::v3::Cluster::V4_PREFERRED: | ||
dns_cluster.set_dns_lookup_family(envoy::extensions::clusters::common::dns::v3::V4_PREFERRED); | ||
break; | ||
case envoy::config::cluster::v3::Cluster::ALL: | ||
dns_cluster.set_dns_lookup_family(envoy::extensions::clusters::common::dns::v3::ALL); | ||
break; | ||
} | ||
} | ||
|
||
} // namespace Upstream | ||
} // namespace Envoy |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include "envoy/config/cluster/v3/cluster.pb.h" | ||
#include "envoy/extensions/clusters/dns/v3/dns_cluster.pb.h" | ||
|
||
namespace Envoy { | ||
namespace Upstream { | ||
|
||
void createDnsClusterFromLegacyFields( | ||
const envoy::config::cluster::v3::Cluster& cluster, | ||
envoy::extensions::clusters::dns::v3::DnsCluster& new_proto_config); | ||
|
||
} | ||
} // namespace Envoy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this same comment should apply to all DNS-related fields in the
Cluster
proto (e.g.,dns_lookup_family
,dns_resolvers
, etc).We'll need to add corresponding fields to the new
DnsCluster
message for each of those fields.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markdroth @mattklein redis cluster uses these fields, so we will have to update that too?
envoy/source/extensions/clusters/redis/redis_cluster.cc
Lines 61 to 62 in b28b7f6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with the redis cluster type, but I suspect that we do want it to have its own parameters for DNS configuration. But I would also be okay with deferring some of that to a separate PR: we could document that these fields are deprecated for the STRICT_DNS and LOGICAL_DNS cluster types only for now, but add TODO comments indicating that we will eventually deprecate them for redis as well.