@@ -1842,6 +1842,10 @@ func configureClusterWithHostnames(
18421842 rate := 10 * time .Second
18431843 cluster .DnsRefreshRate = durationpb .New (rate )
18441844 cluster .DnsLookupFamily = envoy_cluster_v3 .Cluster_V4_ONLY
1845+ ds , _ := netutil .IsDualStack (nil , true )
1846+ if ds {
1847+ cluster .DnsLookupFamily = envoy_cluster_v3 .Cluster_ALL
1848+ }
18451849
18461850 envoyMaxEndpoints := 1
18471851 discoveryType := envoy_cluster_v3.Cluster_Type {Type : envoy_cluster_v3 .Cluster_LOGICAL_DNS }
@@ -1945,15 +1949,19 @@ func (s *ResourceGenerator) makeExternalIPCluster(snap *proxycfg.ConfigSnapshot,
19451949func (s * ResourceGenerator ) makeExternalHostnameCluster (snap * proxycfg.ConfigSnapshot , opts clusterOpts , discoveryType envoy_cluster_v3.Cluster_DiscoveryType ) * envoy_cluster_v3.Cluster {
19461950 cfg := snap .GetGatewayConfig (s .Logger )
19471951 opts .connectTimeout = time .Duration (cfg .ConnectTimeoutMs ) * time .Millisecond
1948-
1952+ dlf := envoy_cluster_v3 .Cluster_V4_ONLY
1953+ ds , _ := netutil .IsDualStack (nil , true )
1954+ if ds {
1955+ dlf = envoy_cluster_v3 .Cluster_ALL
1956+ }
19491957 cluster := & envoy_cluster_v3.Cluster {
19501958 Name : opts .name ,
19511959 ConnectTimeout : durationpb .New (opts .connectTimeout ),
19521960
19531961 // Having an empty config enables outlier detection with default config.
19541962 OutlierDetection : & envoy_cluster_v3.OutlierDetection {},
19551963 ClusterDiscoveryType : & envoy_cluster_v3.Cluster_Type {Type : discoveryType },
1956- DnsLookupFamily : envoy_cluster_v3 . Cluster_V4_ONLY ,
1964+ DnsLookupFamily : dlf ,
19571965 }
19581966
19591967 rate := 10 * time .Second
0 commit comments