From 67aa7ed15c144d460cd5c505893bcf8624d928cb Mon Sep 17 00:00:00 2001 From: freddygv Date: Mon, 8 Aug 2022 08:31:47 -0600 Subject: [PATCH] Test fixes --- agent/consul/fsm/snapshot_oss_test.go | 10 ++++------ proto/pbpeering/peering.proto | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/agent/consul/fsm/snapshot_oss_test.go b/agent/consul/fsm/snapshot_oss_test.go index 2a04c701b..4dcea88b6 100644 --- a/agent/consul/fsm/snapshot_oss_test.go +++ b/agent/consul/fsm/snapshot_oss_test.go @@ -485,9 +485,9 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) { }, SecretsRequest: &pbpeering.SecretsWriteRequest{ PeerID: "1fabcd52-1d46-49b0-b1d8-71559aee47f5", - Request: &pbpeering.SecretsWriteRequest_PromotePending{ - PromotePending: &pbpeering.SecretsWriteRequest_PromotePendingRequest{ - ActiveStreamSecret: "baaeea83-8419-4aa8-ac89-14e7246a3d2f", + Request: &pbpeering.SecretsWriteRequest_GenerateToken{ + GenerateToken: &pbpeering.SecretsWriteRequest_GenerateTokenRequest{ + EstablishmentSecret: "baaeea83-8419-4aa8-ac89-14e7246a3d2f", }, }, }, @@ -503,7 +503,6 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) { // Issue two more secrets writes so that there are three secrets associated with the peering: // - Establishment: "389bbcdf-1c31-47d6-ae96-f2a3f4c45f84" // - Pending: "0b7812d4-32d9-4e54-b1b3-4d97084982a0" - // - Active: "baaeea83-8419-4aa8-ac89-14e7246a3d2f" require.NoError(t, fsm.state.PeeringSecretsWrite(34, &pbpeering.SecretsWriteRequest{ PeerID: "1fabcd52-1d46-49b0-b1d8-71559aee47f5", Request: &pbpeering.SecretsWriteRequest_ExchangeSecret{ @@ -837,12 +836,11 @@ func TestFSM_SnapshotRestore_OSS(t *testing.T) { }, Stream: &pbpeering.PeeringSecrets_Stream{ PendingSecretID: "0b7812d4-32d9-4e54-b1b3-4d97084982a0", - ActiveSecretID: "baaeea83-8419-4aa8-ac89-14e7246a3d2f", }, } prototest.AssertDeepEqual(t, expectSecrets, secretsRestored) - uuids := []string{"389bbcdf-1c31-47d6-ae96-f2a3f4c45f84", "0b7812d4-32d9-4e54-b1b3-4d97084982a0", "baaeea83-8419-4aa8-ac89-14e7246a3d2f"} + uuids := []string{"389bbcdf-1c31-47d6-ae96-f2a3f4c45f84", "0b7812d4-32d9-4e54-b1b3-4d97084982a0"} for _, id := range uuids { free, err := fsm2.state.ValidateProposedPeeringSecretUUID(id) require.NoError(t, err) diff --git a/proto/pbpeering/peering.proto b/proto/pbpeering/peering.proto index b3042d263..41abf0596 100644 --- a/proto/pbpeering/peering.proto +++ b/proto/pbpeering/peering.proto @@ -69,7 +69,7 @@ message SecretsWriteRequest { // GenerateTokenRequest encodes a request to persist a peering establishment // secret. It is triggered by generating a new peering token for a peer cluster. - message GenerateTokenRequest{ + message GenerateTokenRequest { // establishment_secret is the proposed secret ID to store as the establishment // secret for this peering. string establishment_secret = 1;