From 06258c38e967f7e5ba748cca9f7b95d317e976d7 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Tue, 12 Jul 2022 12:05:52 -0400 Subject: [PATCH] secure vars: fix enterprise test by upserting the namespace (#13719) In OSS we can upsert an allocation without worrying about whether that alloc is in a namespace that actually exists, but in ENT that upsert will add to the namespace's quotas. Ensure we're doing so in this secure variables RPC test to fix the test breaking in the ENT repo. --- nomad/secure_variables_endpoint_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nomad/secure_variables_endpoint_test.go b/nomad/secure_variables_endpoint_test.go index 00ef54bc3..2649b0d36 100644 --- a/nomad/secure_variables_endpoint_test.go +++ b/nomad/secure_variables_endpoint_test.go @@ -40,8 +40,9 @@ func TestSecureVariablesEndpoint_auth(t *testing.T) { alloc2.Namespace = ns store := srv.fsm.State() + require.NoError(t, store.UpsertNamespaces(1000, []*structs.Namespace{{Name: ns}})) require.NoError(t, store.UpsertAllocs( - structs.MsgTypeTestSetup, 1000, []*structs.Allocation{alloc1, alloc2})) + structs.MsgTypeTestSetup, 1001, []*structs.Allocation{alloc1, alloc2})) claims1 := alloc1.ToTaskIdentityClaims("web") idToken, err := srv.encrypter.SignClaims(claims1)