diff --git a/agent/consul/state/config_entry.go b/agent/consul/state/config_entry.go index 28d377a82..1d3358029 100644 --- a/agent/consul/state/config_entry.go +++ b/agent/consul/state/config_entry.go @@ -16,7 +16,6 @@ type ConfigEntryLinkIndex struct { } type discoveryChainConfigEntry interface { - structs.ConfigEntry // ListRelatedServices returns a list of other names of services referenced // in this config entry. ListRelatedServices() []structs.ServiceID @@ -426,7 +425,7 @@ func (s *Store) discoveryChainSourcesTxn(tx ReadTxn, ws memdb.WatchSet, dc strin queue := []structs.ServiceName{destination} for len(queue) > 0 { // The "link" index returns config entries that reference a service - iter, err := tx.Get(tableConfigEntries, "link", queue[0].ToServiceID()) + iter, err := tx.Get(tableConfigEntries, indexLink, queue[0].ToServiceID()) if err != nil { return 0, nil, err } @@ -598,7 +597,7 @@ func validateProposedConfigEntryInServiceGraph( sid := structs.NewServiceID(name, entMeta) checkChains[sid] = struct{}{} - iter, err := tx.Get(tableConfigEntries, "link", sid) + iter, err := tx.Get(tableConfigEntries, indexLink, sid) if err != nil { return err } diff --git a/agent/consul/state/config_entry_intention.go b/agent/consul/state/config_entry_intention.go index f8d91efce..98fcecbfa 100644 --- a/agent/consul/state/config_entry_intention.go +++ b/agent/consul/state/config_entry_intention.go @@ -150,7 +150,7 @@ func configIntentionGetTxn(tx ReadTxn, ws memdb.WatchSet, id string) (uint64, *s idx = 1 } - watchCh, existing, err := tx.FirstWatch(tableConfigEntries, "intention-legacy-id", id) + watchCh, existing, err := tx.FirstWatch(tableConfigEntries, indexIntentionLegacyID, id) if err != nil { return 0, nil, nil, fmt.Errorf("failed config entry lookup: %s", err) } @@ -265,7 +265,7 @@ func readSourceIntentionsFromConfigEntriesTxn(tx ReadTxn, ws memdb.WatchSet, ser func readSourceIntentionsFromConfigEntriesForServiceTxn(tx ReadTxn, ws memdb.WatchSet, serviceName string, entMeta *structs.EnterpriseMeta, results structs.Intentions) (structs.Intentions, error) { sn := structs.NewServiceName(serviceName, entMeta) - iter, err := tx.Get(tableConfigEntries, "intention-source", sn) + iter, err := tx.Get(tableConfigEntries, indexSource, sn) if err != nil { return nil, fmt.Errorf("failed config entry lookup: %s", err) }