Skip to content

Commit

Permalink
Renamed ensureCheckIfNodeMatches() as requested by @banks
Browse files Browse the repository at this point in the history
  • Loading branch information
pierresouchay committed Aug 14, 2018
1 parent ef476f9 commit cb05557
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/consul/state/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (s *Store) EnsureRegistration(idx uint64, req *structs.RegisterRequest) err
return nil
}

func (s *Store) ensureCheckIsCorrect(tx *memdb.Txn, idx uint64, node string, check *structs.HealthCheck) error {
func (s *Store) ensureCheckIfNodeMatches(tx *memdb.Txn, idx uint64, node string, check *structs.HealthCheck) error {
if check.Node != node {
return fmt.Errorf("check node %q does not match node %q",
check.Node, node)
Expand Down Expand Up @@ -327,12 +327,12 @@ func (s *Store) ensureRegistrationTxn(tx *memdb.Txn, idx uint64, req *structs.Re

// Add the checks, if any.
if req.Check != nil {
if err := s.ensureCheckIsCorrect(tx, idx, req.Node, req.Check); err != nil {
if err := s.ensureCheckIfNodeMatches(tx, idx, req.Node, req.Check); err != nil {
return err
}
}
for _, check := range req.Checks {
if err := s.ensureCheckIsCorrect(tx, idx, req.Node, check); err != nil {
if err := s.ensureCheckIfNodeMatches(tx, idx, req.Node, check); err != nil {
return err
}
}
Expand Down

0 comments on commit cb05557

Please sign in to comment.