structs: remove two methods that were only used once each.

These methods only called a single function. Wrappers like this end up making code harder to read
because it adds extra ways of doing things.

We already have many helper functions for constructing these types, we don't need additional methods.
This commit is contained in:
Daniel Nephin 2021-09-17 19:19:42 -04:00
parent 8d1378cc1d
commit 6d72517682
3 changed files with 2 additions and 10 deletions

View File

@ -98,7 +98,7 @@ func (s *handlerConnectProxy) initialize(ctx context.Context) (ConfigSnapshot, e
Name: structs.MeshConfigMesh,
Datacenter: s.source.Datacenter,
QueryOptions: structs.QueryOptions{Token: s.token},
EnterpriseMeta: *s.proxyID.DefaultEnterpriseMetaForPartition(),
EnterpriseMeta: *structs.DefaultEnterpriseMetaInPartition(s.proxyID.PartitionOrDefault()),
}, meshConfigEntryID, s.ch)
if err != nil {
return snap, err

View File

@ -1506,7 +1506,7 @@ type HealthCheck struct {
func (hc *HealthCheck) NodeIdentity() Identity {
return Identity{
ID: hc.Node,
EnterpriseMeta: *hc.NodeEnterpriseMetaForPartition(),
EnterpriseMeta: *NodeEnterpriseMetaInPartition(hc.PartitionOrDefault()),
}
}

View File

@ -46,14 +46,6 @@ func (m *EnterpriseMeta) WildcardEnterpriseMetaForPartition() *EnterpriseMeta {
return &emptyEnterpriseMeta
}
func (m *EnterpriseMeta) DefaultEnterpriseMetaForPartition() *EnterpriseMeta {
return &emptyEnterpriseMeta
}
func (m *EnterpriseMeta) NodeEnterpriseMetaForPartition() *EnterpriseMeta {
return &emptyEnterpriseMeta
}
func (m *EnterpriseMeta) NewEnterpriseMetaInPartition(_ string) *EnterpriseMeta {
return &emptyEnterpriseMeta
}