From 4756ff059dff7db60c6c2a75fb720520ee1384bd Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 26 Feb 2021 13:34:14 -0500 Subject: [PATCH] state: update calls to ensureConfigEntryTxn The EnterpriseMeta paramter was removed after this code was written, but before it merged. Also the table name constant has changed. --- agent/consul/state/catalog_events.go | 2 +- agent/consul/state/catalog_events_test.go | 32 +++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/agent/consul/state/catalog_events.go b/agent/consul/state/catalog_events.go index 4860141445..4a088ed8fc 100644 --- a/agent/consul/state/catalog_events.go +++ b/agent/consul/state/catalog_events.go @@ -203,7 +203,7 @@ func ServiceHealthEventsFromChanges(tx ReadTxn, changes Changes) ([]stream.Event markService(newNodeServiceTupleFromServiceHealthCheck(obj), serviceChangeIndirect) } } - case gatewayServicesTableName: + case tableGatewayServices: gs := changeObject(change).(*structs.GatewayService) if gs.GatewayKind != structs.ServiceKindTerminatingGateway { continue diff --git a/agent/consul/state/catalog_events_test.go b/agent/consul/state/catalog_events_test.go index f45848a94b..83d7cd184a 100644 --- a/agent/consul/state/catalog_events_test.go +++ b/agent/consul/state/catalog_events_test.go @@ -1030,7 +1030,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - return ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + return ensureConfigEntryTxn(tx, tx.Index, configEntry) }, WantEvents: []stream.Event{}, }, @@ -1052,7 +1052,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - return ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + return ensureConfigEntryTxn(tx, tx.Index, configEntry) }, Mutate: func(s *Store, tx *txn) error { if err := s.ensureRegistrationTxn( @@ -1111,7 +1111,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1172,7 +1172,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - return ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + return ensureConfigEntryTxn(tx, tx.Index, configEntry) }, WantEvents: []stream.Event{ testServiceHealthEvent(t, @@ -1201,7 +1201,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1224,7 +1224,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - return ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + return ensureConfigEntryTxn(tx, tx.Index, configEntry) }, WantEvents: []stream.Event{ testServiceHealthEvent(t, @@ -1252,7 +1252,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1271,7 +1271,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - return ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + return ensureConfigEntryTxn(tx, tx.Index, configEntry) }, WantEvents: []stream.Event{ testServiceHealthDeregistrationEvent(t, @@ -1294,7 +1294,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1314,7 +1314,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - return ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + return ensureConfigEntryTxn(tx, tx.Index, configEntry) }, WantEvents: []stream.Event{ testServiceHealthDeregistrationEvent(t, @@ -1342,7 +1342,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1384,7 +1384,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1412,7 +1412,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1444,7 +1444,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1459,7 +1459,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err = ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err = ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err } @@ -1518,7 +1518,7 @@ func TestServiceHealthEventsFromChanges(t *testing.T) { }, EnterpriseMeta: *structs.DefaultEnterpriseMeta(), } - err := ensureConfigEntryTxn(tx, tx.Index, configEntry, structs.DefaultEnterpriseMeta()) + err := ensureConfigEntryTxn(tx, tx.Index, configEntry) if err != nil { return err }