Skip to content

Commit

Permalink
Merge pull request #2942 from buildkite/fix-k8s-access-token
Browse files Browse the repository at this point in the history
k8s: Unconditionally set BUILDKITE_AGENT_ACCESS_TOKEN
  • Loading branch information
DrJosh9000 authored Aug 20, 2024
2 parents 30bbe14 + 7da8091 commit ffc3bce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/job/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ffc3bce

Please sign in to comment.