From f9a89db86e95f207806b62e55c89b81d705808d9 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 20 May 2020 16:34:14 -0400 Subject: [PATCH] Update agent/consul/state/catalog.go Co-authored-by: Hans Hasselberg --- agent/consul/state/catalog.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/consul/state/catalog.go b/agent/consul/state/catalog.go index 82ea05028..8a0f8469a 100644 --- a/agent/consul/state/catalog.go +++ b/agent/consul/state/catalog.go @@ -740,7 +740,7 @@ func (s *Store) EnsureService(idx uint64, node string, svc *structs.NodeService) var errCASCompareFailed = errors.New("compare-and-set: comparison failed") // ensureServiceCASTxn updates a service only if the existing index matches the given index. -// Returns a bool indicating if a write happened and any error. +// Returns an error if the write didn't happen and nil if write was successful. func (s *Store) ensureServiceCASTxn(tx *memdb.Txn, idx uint64, node string, svc *structs.NodeService) error { // Retrieve the existing service. _, existing, err := firstWatchCompoundWithTxn(tx, "services", "id", &svc.EnterpriseMeta, node, svc.ID)