diff --git a/agent/consul/state/catalog.go b/agent/consul/state/catalog.go index 8308183af..72b4ba564 100644 --- a/agent/consul/state/catalog.go +++ b/agent/consul/state/catalog.go @@ -3451,8 +3451,8 @@ func updateMeshTopology(tx WriteTxn, idx uint64, node string, svc *structs.NodeS oldUpstreams := make(map[structs.ServiceName]bool) if e, ok := existing.(*structs.ServiceNode); ok { for _, u := range e.ServiceProxy.Upstreams { - upstreamMeta := e.NewEnterpriseMetaInPartition(u.DestinationNamespace) - sn := structs.NewServiceName(u.DestinationName, upstreamMeta) + upstreamMeta := structs.NewEnterpriseMetaWithPartition(e.PartitionOrDefault(), u.DestinationNamespace) + sn := structs.NewServiceName(u.DestinationName, &upstreamMeta) oldUpstreams[sn] = true } @@ -3467,8 +3467,8 @@ func updateMeshTopology(tx WriteTxn, idx uint64, node string, svc *structs.NodeS } // TODO (freddy): Account for upstream datacenter - upstreamMeta := svc.NewEnterpriseMetaInPartition(u.DestinationNamespace) - upstream := structs.NewServiceName(u.DestinationName, upstreamMeta) + upstreamMeta := structs.NewEnterpriseMetaWithPartition(svc.PartitionOrDefault(), u.DestinationNamespace) + upstream := structs.NewServiceName(u.DestinationName, &upstreamMeta) obj, err := tx.First(tableMeshTopology, indexID, upstream, downstream) if err != nil { diff --git a/agent/consul/state/config_entry.go b/agent/consul/state/config_entry.go index c6f568e7a..1dc00e046 100644 --- a/agent/consul/state/config_entry.go +++ b/agent/consul/state/config_entry.go @@ -402,8 +402,8 @@ func (s *Store) discoveryChainTargetsTxn(tx ReadTxn, ws memdb.WatchSet, dc, serv var resp []structs.ServiceName for _, t := range chain.Targets { - em := entMeta.NewEnterpriseMetaInPartition(t.Namespace) - target := structs.NewServiceName(t.Service, em) + em := structs.NewEnterpriseMetaWithPartition(entMeta.PartitionOrDefault(), t.Namespace) + target := structs.NewServiceName(t.Service, &em) // TODO (freddy): Allow upstream DC and encode in response if t.Datacenter == dc { @@ -459,8 +459,8 @@ func (s *Store) discoveryChainSourcesTxn(tx ReadTxn, ws memdb.WatchSet, dc strin } for _, t := range chain.Targets { - em := sn.NewEnterpriseMetaInPartition(t.Namespace) - candidate := structs.NewServiceName(t.Service, em) + em := structs.NewEnterpriseMetaWithPartition(sn.PartitionOrDefault(), t.Namespace) + candidate := structs.NewServiceName(t.Service, &em) if !candidate.Matches(destination) { continue diff --git a/agent/structs/structs_oss.go b/agent/structs/structs_oss.go index 8faecb116..7a72d0cab 100644 --- a/agent/structs/structs_oss.go +++ b/agent/structs/structs_oss.go @@ -46,10 +46,6 @@ func (m *EnterpriseMeta) WildcardEnterpriseMetaForPartition() *EnterpriseMeta { return &emptyEnterpriseMeta } -func (m *EnterpriseMeta) NewEnterpriseMetaInPartition(_ string) *EnterpriseMeta { - return &emptyEnterpriseMeta -} - // TODO(partition): stop using this func NewEnterpriseMetaInDefaultPartition(_ string) EnterpriseMeta { return emptyEnterpriseMeta