Skip to content

Commit 7da8091

Browse files
committed
k8s: Unconditionally set BUILDKITE_AGENT_ACCESS_TOKEN
1 parent 30bbe14 commit 7da8091

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/job/executor.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,16 @@ func (e *Executor) kubernetesSetup(ctx context.Context, k8sAgentSocket *kubernet
12441244
switch n {
12451245
case "BUILDKITE_COMMAND", "BUILDKITE_ARTIFACT_PATHS", "BUILDKITE_PLUGINS":
12461246
continue
1247+
1248+
case "BUILDKITE_AGENT_ACCESS_TOKEN":
1249+
// Just in case someone has tried to fiddle with this, set it
1250+
// unconditionally (to be compatible with pre-v3.74.1 / PR 2851
1251+
// behavior).
1252+
e.shell.Env.Set(n, v)
1253+
if err := os.Setenv(n, v); err != nil {
1254+
return err
1255+
}
1256+
continue
12471257
}
12481258
// Skip any that are already set.
12491259
if e.shell.Env.Exists(n) {

0 commit comments

Comments
 (0)