diff --git a/agent/xds/clusters.go b/agent/xds/clusters.go index d6165569a0..2f3c1c3b10 100644 --- a/agent/xds/clusters.go +++ b/agent/xds/clusters.go @@ -629,9 +629,15 @@ func (s *ResourceGenerator) makeGatewayOutgoingClusterPeeringServiceClusters(cfg // usual mesh gateway route for a service. clusterName := node.Service.Connect.PeerMeta.PrimarySNI() + var hostnameEndpoints structs.CheckServiceNodes + if serviceGroup.UseCDS { + hostnameEndpoints = serviceGroup.Nodes + } + opts := clusterOpts{ - name: clusterName, - isRemote: true, + name: clusterName, + isRemote: true, + hostnameEndpoints: hostnameEndpoints, } cluster := s.makeGatewayCluster(cfgSnap, opts) diff --git a/agent/xds/testdata/clusters/mesh-gateway-with-imported-peered-services.latest.golden b/agent/xds/testdata/clusters/mesh-gateway-with-imported-peered-services.latest.golden index 27761e8114..88f75c8868 100644 --- a/agent/xds/testdata/clusters/mesh-gateway-with-imported-peered-services.latest.golden +++ b/agent/xds/testdata/clusters/mesh-gateway-with-imported-peered-services.latest.golden @@ -5,14 +5,6 @@ "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster", "name": "alt.default.default.peer-b.external.1c053652-8512-4373-90cf-5a7f6263a994.consul", "type": "LOGICAL_DNS", - "edsClusterConfig": { - "edsConfig": { - "ads": { - - }, - "resourceApiVersion": "V3" - } - }, "connectTimeout": "5s", "loadAssignment": { "clusterName": "alt.default.default.peer-b.external.1c053652-8512-4373-90cf-5a7f6263a994.consul",