From 7da80912c600122862c500eac98478f80ed51b37 Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Tue, 20 Aug 2024 11:07:58 +1000 Subject: [PATCH] k8s: Unconditionally set BUILDKITE_AGENT_ACCESS_TOKEN --- internal/job/executor.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/job/executor.go b/internal/job/executor.go index c15b94ae80..1cdedb1a2c 100644 --- a/internal/job/executor.go +++ b/internal/job/executor.go @@ -1244,6 +1244,16 @@ func (e *Executor) kubernetesSetup(ctx context.Context, k8sAgentSocket *kubernet switch n { case "BUILDKITE_COMMAND", "BUILDKITE_ARTIFACT_PATHS", "BUILDKITE_PLUGINS": continue + + case "BUILDKITE_AGENT_ACCESS_TOKEN": + // Just in case someone has tried to fiddle with this, set it + // unconditionally (to be compatible with pre-v3.74.1 / PR 2851 + // behavior). + e.shell.Env.Set(n, v) + if err := os.Setenv(n, v); err != nil { + return err + } + continue } // Skip any that are already set. if e.shell.Env.Exists(n) {