From 9812b321551a79f383287dbd72142df5f1c908ab Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Tue, 10 Dec 2019 13:58:30 -0500 Subject: [PATCH] Fix blocking for ServiceDumping by kind (#6919) --- agent/consul/state/catalog_oss.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/agent/consul/state/catalog_oss.go b/agent/consul/state/catalog_oss.go index e81f84d7c..97b249184 100644 --- a/agent/consul/state/catalog_oss.go +++ b/agent/consul/state/catalog_oss.go @@ -208,14 +208,18 @@ func (s *Store) catalogInsertService(tx *memdb.Txn, svc *structs.ServiceNode) er return fmt.Errorf("failed inserting service: %s", err) } - // overall services index - if err := tx.Insert("index", &IndexEntry{"services", svc.ModifyIndex}); err != nil { - return fmt.Errorf("failed updating index: %s", err) + if err := s.catalogUpdateServicesIndexes(tx, svc.ModifyIndex, &svc.EnterpriseMeta); err != nil { + return err } if err := s.catalogUpdateServiceIndexes(tx, svc.ServiceName, svc.ModifyIndex, &svc.EnterpriseMeta); err != nil { return err } + + if err := s.catalogUpdateServiceKindIndexes(tx, svc.ServiceKind, svc.ModifyIndex, &svc.EnterpriseMeta); err != nil { + return err + } + return nil }