diff --git a/agent/proxycfg/data_sources.go b/agent/proxycfg/data_sources.go index ef81af3766..2a5e2b4d3a 100644 --- a/agent/proxycfg/data_sources.go +++ b/agent/proxycfg/data_sources.go @@ -47,7 +47,7 @@ type DataSources struct { // notification channel. GatewayServices GatewayServices - // GatewayServices provides updates about a gateway's upstream services on a + // ServiceGateways provides updates about a gateway's upstream services on a // notification channel. ServiceGateways ServiceGateways diff --git a/agent/proxycfg/testing.go b/agent/proxycfg/testing.go index 441e9c5f2a..45fa622822 100644 --- a/agent/proxycfg/testing.go +++ b/agent/proxycfg/testing.go @@ -743,6 +743,7 @@ func testConfigSnapshotFixture( Datacenters: &noopDataSource[*structs.DatacentersRequest]{}, FederationStateListMeshGateways: &noopDataSource[*structs.DCSpecificRequest]{}, GatewayServices: &noopDataSource[*structs.ServiceSpecificRequest]{}, + ServiceGateways: &noopDataSource[*structs.ServiceSpecificRequest]{}, Health: &noopDataSource[*structs.ServiceSpecificRequest]{}, HTTPChecks: &noopDataSource[*cachetype.ServiceHTTPChecksRequest]{}, Intentions: &noopDataSource[*structs.IntentionQueryRequest]{}, @@ -971,6 +972,7 @@ type TestDataSources struct { FederationStateListMeshGateways *TestDataSource[*structs.DCSpecificRequest, *structs.DatacenterIndexedCheckServiceNodes] Datacenters *TestDataSource[*structs.DatacentersRequest, *[]string] GatewayServices *TestDataSource[*structs.ServiceSpecificRequest, *structs.IndexedGatewayServices] + ServiceGateways *TestDataSource[*structs.ServiceSpecificRequest, *structs.IndexedServiceNodes] Health *TestDataSource[*structs.ServiceSpecificRequest, *structs.IndexedCheckServiceNodes] HTTPChecks *TestDataSource[*cachetype.ServiceHTTPChecksRequest, []structs.CheckType] Intentions *TestDataSource[*structs.IntentionQueryRequest, *structs.IndexedIntentionMatches] @@ -995,6 +997,7 @@ func (t *TestDataSources) ToDataSources() DataSources { ConfigEntryList: t.ConfigEntryList, Datacenters: t.Datacenters, GatewayServices: t.GatewayServices, + ServiceGateways: t.ServiceGateways, Health: t.Health, HTTPChecks: t.HTTPChecks, Intentions: t.Intentions, diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index 7485fa51e2..54aee83472 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -234,7 +234,11 @@ func (s *ResourceGenerator) listenersFromSnapshotConnectProxy(cfgSnap *proxycfg. upstreamCfg := cfgSnap.ConnectProxy.UpstreamConfig[uid] cfg := s.getAndModifyUpstreamConfigForListener(uid, upstreamCfg, nil) filterName := fmt.Sprintf("%s.%s.%s.%s", destination.GetName(), destination.GetEnterpriseMeta().NamespaceOrDefault(), destination.GetEnterpriseMeta().PartitionOrDefault(), cfgSnap.Datacenter) - clusterName := filterName + sni := connect.ServiceSNI( + uid.Name, "", uid.NamespaceOrDefault(), uid.PartitionOrDefault(), cfgSnap.Datacenter, cfgSnap.Roots.TrustDomain) + + // Prefixed with destination to distinguish from non-passthrough clusters for the same upstream. + clusterName := "destination~" + sni filterChain, err := s.makeUpstreamFilterChain(filterChainOpts{ routeName: uid.EnvoyID(), clusterName: clusterName, @@ -1664,7 +1668,6 @@ func (s *ResourceGenerator) makeUpstreamFilterChain(opts filterChainOpts) (*envo return nil, err } return &envoy_listener_v3.FilterChain{ - Name: opts.filterName, Filters: []*envoy_listener_v3.Filter{ filter, },