From 82b6a7a4d04ed2674e59a62b0d221a80334e3a15 Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 22:27:59 +0000 Subject: [PATCH] Mirrored from envoyproxy/envoy @ b5c15a323dc20d02a50ee31227bb353cd8069df2 Signed-off-by: update-envoy[bot] <135279899+update-envoy[bot]@users.noreply.github.com> --- envoy/COMMIT | 2 +- .../cares/v3/cares_dns_resolver.pb.go | 46 +++++++++++++------ .../v3/cares_dns_resolver.pb.validate.go | 2 + .../cares/v3/cares_dns_resolver_vtproto.pb.go | 13 ++++++ 4 files changed, 47 insertions(+), 16 deletions(-) diff --git a/envoy/COMMIT b/envoy/COMMIT index 7ba95c1fc..5492ab538 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -8aabe0f9ae2834985f92b6a5e378a8c93bce0c7c +b5c15a323dc20d02a50ee31227bb353cd8069df2 diff --git a/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.go b/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.go index 969da3f12..077371279 100755 --- a/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.go +++ b/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.go @@ -25,7 +25,7 @@ const ( ) // Configuration for c-ares DNS resolver. -// [#next-free-field: 8] +// [#next-free-field: 9] type CaresDnsResolverConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -64,6 +64,12 @@ type CaresDnsResolverConfig struct { // Note: While the c-ares library defaults to 3 attempts, Envoy's default (if this field is unset) is 4 attempts. // This adjustment was made to maintain the previous behavior after users reported an increase in DNS resolution times. QueryTries *wrapperspb.UInt32Value `protobuf:"bytes,7,opt,name=query_tries,json=queryTries,proto3" json:"query_tries,omitempty"` + // Enable round-robin selection of name servers for DNS resolution. When enabled, the resolver will cycle through the + // list of name servers for each resolution request. This can help distribute the query load across multiple name + // servers. If disabled (default), the resolver will try name servers in the order they are configured. + // + // Note: This setting overrides any system configuration for name server rotation. + RotateNameservers bool `protobuf:"varint,8,opt,name=rotate_nameservers,json=rotateNameservers,proto3" json:"rotate_nameservers,omitempty"` } func (x *CaresDnsResolverConfig) Reset() { @@ -147,6 +153,13 @@ func (x *CaresDnsResolverConfig) GetQueryTries() *wrapperspb.UInt32Value { return nil } +func (x *CaresDnsResolverConfig) GetRotateNameservers() bool { + if x != nil { + return x.RotateNameservers + } + return false +} + var File_envoy_extensions_network_dns_resolver_cares_v3_cares_dns_resolver_proto protoreflect.FileDescriptor var file_envoy_extensions_network_dns_resolver_cares_v3_cares_dns_resolver_proto_rawDesc = []byte{ @@ -167,7 +180,7 @@ var file_envoy_extensions_network_dns_resolver_cares_v3_cares_dns_resolver_proto 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x93, 0x04, 0x0a, 0x16, 0x43, + 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x04, 0x0a, 0x16, 0x43, 0x61, 0x72, 0x65, 0x73, 0x44, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, @@ -201,19 +214,22 @@ var file_envoy_extensions_network_dns_resolver_cares_v3_cares_dns_resolver_proto 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x0a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x54, 0x72, 0x69, 0x65, 0x73, - 0x42, 0xbe, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x3c, 0x69, 0x6f, 0x2e, - 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2e, 0x64, 0x6e, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, - 0x2e, 0x63, 0x61, 0x72, 0x65, 0x73, 0x2e, 0x76, 0x33, 0x42, 0x15, 0x43, 0x61, 0x72, 0x65, 0x73, - 0x44, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x5d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, - 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, - 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2f, 0x64, 0x6e, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, - 0x2f, 0x63, 0x61, 0x72, 0x65, 0x73, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x61, 0x72, 0x65, 0x73, 0x76, - 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x2d, 0x0a, 0x12, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x72, 0x6f, + 0x74, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x42, + 0xbe, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, 0x3c, 0x69, 0x6f, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2e, 0x64, 0x6e, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2e, + 0x63, 0x61, 0x72, 0x65, 0x73, 0x2e, 0x76, 0x33, 0x42, 0x15, 0x43, 0x61, 0x72, 0x65, 0x73, 0x44, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x5d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, + 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x64, 0x6e, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x72, 0x2f, + 0x63, 0x61, 0x72, 0x65, 0x73, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x61, 0x72, 0x65, 0x73, 0x76, 0x33, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.validate.go b/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.validate.go index c7b3cfef7..993496a5c 100755 --- a/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.validate.go +++ b/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver.pb.validate.go @@ -184,6 +184,8 @@ func (m *CaresDnsResolverConfig) validate(all bool) error { } + // no validation rules for RotateNameservers + if len(errors) > 0 { return CaresDnsResolverConfigMultiError(errors) } diff --git a/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver_vtproto.pb.go b/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver_vtproto.pb.go index c284961d4..19d54dbbb 100755 --- a/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver_vtproto.pb.go +++ b/envoy/extensions/network/dns_resolver/cares/v3/cares_dns_resolver_vtproto.pb.go @@ -50,6 +50,16 @@ func (m *CaresDnsResolverConfig) MarshalToSizedBufferVTStrict(dAtA []byte) (int, i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.RotateNameservers { + i-- + if m.RotateNameservers { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } if m.QueryTries != nil { size, err := (*wrapperspb.UInt32Value)(m.QueryTries).MarshalToSizedBufferVTStrict(dAtA[:i]) if err != nil { @@ -195,6 +205,9 @@ func (m *CaresDnsResolverConfig) SizeVT() (n int) { l = (*wrapperspb.UInt32Value)(m.QueryTries).SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if m.RotateNameservers { + n += 2 + } n += len(m.unknownFields) return n }