mirror of
https://github.com/status-im/consul.git
synced 2025-02-25 11:55:41 +00:00
structs: remove another helper
We already have a helper funtion.
This commit is contained in:
parent
6d72517682
commit
8d8c1f9d5e
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user