Skip to content

Commit 5884a41

Browse files
authored
Merge pull request #3420 from buildkite/ming/ps-1000
PS-1000: ensure a static & short checkout path for k8s stack agent
2 parents a17657e + f4813bd commit 5884a41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clicommand/kubernetes_bootstrap.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ var KubernetesBootstrapCommand = cli.Command{
132132
// (we're doing all that here).
133133
environ.Set("BUILDKITE_KUBERNETES_EXEC", "false")
134134

135+
if _, exists := environ.Get("BUILDKITE_BUILD_CHECKOUT_PATH"); !exists {
136+
// The OG agent runs as a long-live worker, therefore it set a checkout path dynamically to cater
137+
// for different workloads.
138+
// The path can gets really long because Agent name contain auto generated uuid, it might break some customers'
139+
// use case.
140+
// The k8s agent runs emphemerally, there is no need to carefully craft a checkout path.
141+
environ.Set("BUILDKITE_BUILD_CHECKOUT_PATH", filepath.Join(buildPath, "buildkite"))
142+
}
143+
135144
// BUILDKITE_BIN_PATH is a funny one. The bootstrap adds it to PATH,
136145
// and the agent deduces it from its own path (as we do below), but in
137146
// the k8s stack the agent could run from two different locations:

0 commit comments

Comments
 (0)