state: remove duplicate function

catalogChecksForNodeService was a duplicate of catalogListServiceChecks
This commit is contained in:
Daniel Nephin 2021-02-10 16:07:21 -05:00
parent e87d2bb24f
commit b781fec664
2 changed files with 3 additions and 7 deletions

View File

@ -1317,7 +1317,7 @@ func (s *Store) deleteServiceTxn(tx WriteTxn, idx uint64, nodeName, serviceID st
// Delete any checks associated with the service. This will invalidate // Delete any checks associated with the service. This will invalidate
// sessions as necessary. // sessions as necessary.
checks, err := catalogChecksForNodeService(tx, nodeName, serviceID, entMeta) checks, err := catalogListServiceChecks(tx, nodeName, serviceID, entMeta)
if err != nil { if err != nil {
return fmt.Errorf("failed service check lookup: %s", err) return fmt.Errorf("failed service check lookup: %s", err)
} }

View File

@ -157,11 +157,11 @@ func catalogListChecks(tx ReadTxn, _ *structs.EnterpriseMeta) (memdb.ResultItera
} }
func catalogListNodeChecks(tx ReadTxn, node string) (memdb.ResultIterator, error) { func catalogListNodeChecks(tx ReadTxn, node string) (memdb.ResultIterator, error) {
return tx.Get("checks", "node_service_check", node, false) return tx.Get("checks", indexNodeServiceCheck, node, false)
} }
func catalogListServiceChecks(tx ReadTxn, node string, service string, _ *structs.EnterpriseMeta) (memdb.ResultIterator, error) { func catalogListServiceChecks(tx ReadTxn, node string, service string, _ *structs.EnterpriseMeta) (memdb.ResultIterator, error) {
return tx.Get("checks", "node_service", node, service) return tx.Get("checks", indexNodeService, node, service)
} }
func catalogInsertCheck(tx WriteTxn, chk *structs.HealthCheck, idx uint64) error { func catalogInsertCheck(tx WriteTxn, chk *structs.HealthCheck, idx uint64) error {
@ -177,10 +177,6 @@ func catalogInsertCheck(tx WriteTxn, chk *structs.HealthCheck, idx uint64) error
return nil return nil
} }
func catalogChecksForNodeService(tx ReadTxn, node string, service string, entMeta *structs.EnterpriseMeta) (memdb.ResultIterator, error) {
return tx.Get("checks", "node_service", node, service)
}
func validateRegisterRequestTxn(_ ReadTxn, _ *structs.RegisterRequest, _ bool) (*structs.EnterpriseMeta, error) { func validateRegisterRequestTxn(_ ReadTxn, _ *structs.RegisterRequest, _ bool) (*structs.EnterpriseMeta, error) {
return nil, nil return nil, nil
} }