From d9416afee5261652a40cea7410c7d9f63f87f889 Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 4 Jun 2024 10:58:10 -0500 Subject: [PATCH] testing: fix the value of NOMAD_SECRETS_DIR in test harness (#23166) This PR fixes the value of NOMAD_SECRETS_DIR to be the alloc_mounts secrets directory instead of the real secrets directory, which is protected by root 0700 even when running tests. Needed for https://github.com/hashicorp/nomad-driver-exec2/issues/29 --- plugins/drivers/testutils/testing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/drivers/testutils/testing.go b/plugins/drivers/testutils/testing.go index c9c842859..debdfd317 100644 --- a/plugins/drivers/testutils/testing.go +++ b/plugins/drivers/testutils/testing.go @@ -269,7 +269,7 @@ func SetEnvvars(envBuilder *taskenv.Builder, fsmode fsisolation.Mode, taskDir *a // Use mounts host paths envBuilder.SetAllocDir(taskDir.MountsAllocDir) envBuilder.SetTaskLocalDir(filepath.Join(taskDir.MountsTaskDir, "local")) - envBuilder.SetSecretsDir(taskDir.SecretsDir) + envBuilder.SetSecretsDir(taskDir.MountsSecretsDir) case fsisolation.None: // Use host paths envBuilder.SetAllocDir(taskDir.SharedAllocDir)