Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Jin Xuan <sjinxuan@microsoft.com>
  • Loading branch information
Stevenjin8 committed Oct 1, 2024
1 parent 89fcea6 commit 928ef02
Show file tree
Hide file tree
Showing 10 changed files with 255 additions and 299 deletions.
14 changes: 7 additions & 7 deletions api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,8 @@ message Cluster {
// which aggregates all of the DNS configuration in a single message.
google.protobuf.Duration dns_refresh_rate = 16 [
deprecated = true,
(envoy.annotations.deprecated_at_minor_version) = "3.0",
(validate.rules).duration = {gt {nanos: 1000000}}
(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
Expand All @@ -952,7 +952,7 @@ message Cluster {
// This field is deprecated in favor of ``dns_config``
// which aggregates all of the DNS configuration in a single message.
google.protobuf.Duration dns_jitter = 58
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
[deprecated = true, (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>`,
Expand All @@ -965,23 +965,23 @@ message Cluster {
// This field is deprecated in favor of ``dns_config``
// which aggregates all of the DNS configuration in a single message.
envoy.extensions.clusters.dns.v3.DnsConfig.RefreshRate dns_failure_refresh_rate = 44
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
[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.
// This field is deprecated in favor of ``dns_config``
// which aggregates all of the DNS configuration in a single message.
bool respect_dns_ttl = 39
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
[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>`.
envoy.extensions.clusters.dns.v3.DnsConfig.DnsLookupFamily dns_lookup_family = 17 [
deprecated = true,
(envoy.annotations.deprecated_at_minor_version) = "3.0",
(validate.rules).enum = {defined_only: true}
(validate.rules).enum = {defined_only: true},
(envoy.annotations.deprecated_at_minor_version) = "3.0"
];

// If DNS resolvers are specified and the cluster type is either
Expand Down
4 changes: 2 additions & 2 deletions api/envoy/extensions/clusters/dns/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "udpa/annotations/versioning.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.extensions.clusters.dns.v3";
option java_outer_classname = "DnsConfigProto";
option java_outer_classname = "ClusterProto";
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;
Expand Down Expand Up @@ -76,7 +76,7 @@ message DnsConfig {

// 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.
// value defaults to 5000ms.
google.protobuf.Duration dns_refresh_rate = 1 [(validate.rules).duration = {gt {nanos: 1000000}}];

// this is the cluster’s DNS refresh rate when requests are failing. If this setting is
Expand Down
1 change: 0 additions & 1 deletion api/envoy/extensions/common/dynamic_forward_proxy/v3/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ licenses(["notice"]) # Apache 2
api_proto_package(
deps = [
"//envoy/annotations:pkg",
"//envoy/config/cluster/v3:pkg",
"//envoy/config/common/key_value/v3:pkg",
"//envoy/config/core/v3:pkg",
"//envoy/extensions/clusters/dns/v3:pkg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";

package envoy.extensions.common.dynamic_forward_proxy.v3;

import "envoy/config/cluster/v3/cluster.proto";
import "envoy/config/common/key_value/v3/config.proto";
import "envoy/config/core/v3/address.proto";
import "envoy/config/core/v3/extension.proto";
Expand Down Expand Up @@ -54,7 +53,8 @@ message DnsCacheConfig {
// likely build a "happy eyeballs" connection pool which would race the primary / fall back
// address and return the one that wins. This same method could potentially also be used for
// QUIC to TCP fall back.]
envoy.extensions.clusters.dns.v3.DnsConfig.DnsLookupFamily dns_lookup_family = 2 [(validate.rules).enum = {defined_only: true}];
clusters.dns.v3.DnsConfig.DnsLookupFamily dns_lookup_family = 2
[(validate.rules).enum = {defined_only: true}];

// The DNS refresh rate for unresolved DNS hosts. If not specified defaults to 60s.
//
Expand Down
2 changes: 2 additions & 0 deletions source/common/common/dns_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace DnsUtils {
* Utility function to get Dns from cluster/enum.
*/
Network::DnsLookupFamily
getDnsLookupFamilyFromCluster(const envoy::config::cluster::v3::Cluster& cluster);
Network::DnsLookupFamily
getDnsLookupFamilyFromEnum(envoy::extensions::clusters::dns::v3::DnsConfig::DnsLookupFamily family);

// Generates a list of InstanceConstSharedPtr from the DNS responses provided.
Expand Down
8 changes: 4 additions & 4 deletions source/extensions/clusters/strict_dns/strict_dns_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ class StrictDnsClusterImpl : public BaseDynamicClusterImpl {
const LocalInfo::LocalInfo& local_info_;
Network::DnsResolverSharedPtr dns_resolver_;
std::list<ResolveTargetPtr> resolve_targets_;
std::chrono::milliseconds dns_refresh_rate_ms_;
std::chrono::milliseconds dns_jitter_ms_;
const std::chrono::milliseconds dns_refresh_rate_ms_;
const std::chrono::milliseconds dns_jitter_ms_;
BackOffStrategyPtr failure_backoff_strategy_;
bool respect_dns_ttl_;
Network::DnsLookupFamily dns_lookup_family_;
const bool respect_dns_ttl_;
const Network::DnsLookupFamily dns_lookup_family_;
uint32_t overprovisioning_factor_;
bool weighted_priority_health_;
};
Expand Down
Loading

0 comments on commit 928ef02

Please sign in to comment.