Skip to content

Commit

Permalink
xds: use Cluster_AUTO DnsLookupFamily (envoyproxy#4740)
Browse files Browse the repository at this point in the history
* xds: use Cluster_AUTO DnsLookupFamily

Signed-off-by: zirain <zirain2009@gmail.com>

* nit

Signed-off-by: zirain <zirain2009@gmail.com>

* gen

Signed-off-by: zirain <zirain2009@gmail.com>

---------

Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain authored Nov 20, 2024
1 parent 86d750a commit a924cec
Show file tree
Hide file tree
Showing 141 changed files with 10 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -792,7 +791,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -819,7 +817,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -839,7 +836,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -859,7 +855,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"edsClusterConfig": {
"edsConfig": {
"ads": {},
Expand Down Expand Up @@ -488,7 +487,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"edsClusterConfig": {
"edsConfig": {
"ads": {},
Expand Down Expand Up @@ -529,7 +527,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"edsClusterConfig": {
"edsConfig": {
"ads": {},
Expand Down Expand Up @@ -559,7 +556,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"edsClusterConfig": {
"edsConfig": {
"ads": {},
Expand Down Expand Up @@ -589,7 +585,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"edsClusterConfig": {
"edsConfig": {
"ads": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -271,7 +270,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -298,7 +296,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -318,7 +315,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -338,7 +334,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -30,7 +29,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -57,7 +55,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -77,7 +74,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -97,7 +93,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"edsClusterConfig": {
"edsConfig": {
"ads": {},
Expand Down Expand Up @@ -380,7 +379,6 @@
"localityWeightedLbConfig": {}
},
"connectTimeout": "10s",
"dnsLookupFamily": "V4_ONLY",
"dnsRefreshRate": "30s",
"lbPolicy": "LEAST_REQUEST",
"loadAssignment": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -215,7 +214,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
dnsRefreshRate: 30s
lbPolicy: LEAST_REQUEST
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -30,7 +29,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
dnsRefreshRate: 30s
lbPolicy: LEAST_REQUEST
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ xds:
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
13 changes: 10 additions & 3 deletions internal/xds/translator/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,16 @@ func buildEndpointType(settings []*ir.DestinationSetting) EndpointType {
}

func buildXdsCluster(args *xdsClusterArgs) *clusterv3.Cluster {
dnsLookupFamily := clusterv3.Cluster_V4_ONLY
if args.ipFamily != nil && *args.ipFamily == egv1a1.DualStack {
dnsLookupFamily = clusterv3.Cluster_ALL
dnsLookupFamily := clusterv3.Cluster_AUTO
if args.ipFamily != nil {
switch *args.ipFamily {
case egv1a1.IPv4:
dnsLookupFamily = clusterv3.Cluster_V4_ONLY
case egv1a1.IPv6:
dnsLookupFamily = clusterv3.Cluster_V6_ONLY
case egv1a1.DualStack:
dnsLookupFamily = clusterv3.Cluster_ALL
}
}
cluster := &clusterv3.Cluster{
Name: args.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -22,7 +21,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -40,7 +38,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 15s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -22,7 +21,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
dnsRefreshRate: 30s
lbPolicy: LEAST_REQUEST
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -24,7 +23,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
dnsRefreshRate: 30s
lbPolicy: LEAST_REQUEST
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -22,7 +21,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
dnsRefreshRate: 30s
lbPolicy: LEAST_REQUEST
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
edsClusterConfig:
edsConfig:
ads: {}
Expand All @@ -22,7 +21,6 @@
commonLbConfig:
localityWeightedLbConfig: {}
connectTimeout: 10s
dnsLookupFamily: V4_ONLY
dnsRefreshRate: 30s
lbPolicy: LEAST_REQUEST
loadAssignment:
Expand Down
Loading

0 comments on commit a924cec

Please sign in to comment.