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 a0e08086f7
commit 17652227f6
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
}