File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed
Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -747,10 +747,18 @@ var AgentStartCommand = cli.Command{
747747 DebugHTTPFlag ,
748748 TraceHTTPFlag ,
749749
750+ // Kubernetes
751+ cli.BoolFlag {
752+ Name : "kubernetes-exec" ,
753+ Usage : "This is intended to be used only by the Buildkite k8s stack " +
754+ "(github.com/buildkite/agent-stack-k8s); it enables a Unix socket for transporting " +
755+ "logs and exit statuses between containers in a pod" ,
756+ EnvVar : "BUILDKITE_KUBERNETES_EXEC" ,
757+ },
758+
750759 // Other shared flags
751760 RedactedVars ,
752761 StrictSingleHooksFlag ,
753- KubernetesExecFlag ,
754762 TraceContextEncodingFlag ,
755763 NoMultipartArtifactUploadFlag ,
756764
Original file line number Diff line number Diff line change @@ -100,14 +100,6 @@ var (
100100 EnvVar : "BUILDKITE_SOCKETS_PATH" ,
101101 }
102102
103- KubernetesExecFlag = cli.BoolFlag {
104- Name : "kubernetes-exec" ,
105- Usage : "This is intended to be used only by the Buildkite k8s stack " +
106- "(github.com/buildkite/agent-stack-k8s); it enables a Unix socket for transporting " +
107- "logs and exit statuses between containers in a pod" ,
108- EnvVar : "BUILDKITE_KUBERNETES_EXEC" ,
109- }
110-
111103 KubernetesContainerIDFlag = cli.IntFlag {
112104 Name : "kubernetes-container-id" ,
113105 Usage : "This is intended to be used only by the Buildkite k8s stack " +
Original file line number Diff line number Diff line change @@ -123,9 +123,11 @@ var KubernetesBootstrapCommand = cli.Command{
123123 return err
124124 }
125125
126- // Ensure the Kubernetes socket setup is disabled in the subprocess
127- // (we're doing all that here).
128- environ .Set ("BUILDKITE_KUBERNETES_EXEC" , "false" )
126+ // BUILDKITE_KUBERNETES_EXEC is a legacy environment variable. It was used to activate the socket
127+ // on the bootstrap command, and to activate the socket server on `buildkite-agent start`.
128+ // The former has been superseded by this `kubernetes-bootstrap` command.
129+ // We keep this env var because some users depend on it as a k8s environment detection mechanism.
130+ environ .Set ("BUILDKITE_KUBERNETES_EXEC" , "true" )
129131
130132 if _ , exists := environ .Get ("BUILDKITE_BUILD_CHECKOUT_PATH" ); ! exists {
131133 // The OG agent runs as a long-live worker, therefore it set a checkout path dynamically to cater
You can’t perform that action at this time.
0 commit comments