Skip to content

Commit 1858576

Browse files
committed
[supervisor] Pass GITPOD_IMAGE_AUTH to docker-up
Tool: gitpod/catfood.gitpod.cloud
1 parent 064c8fb commit 1858576

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

components/supervisor/pkg/supervisor/config.go

+3
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ type WorkspaceConfig struct {
350350
ConfigcatEnabled bool `env:"GITPOD_CONFIGCAT_ENABLED"`
351351

352352
SSHGatewayCAPublicKey string `env:"GITPOD_SSH_CA_PUBLIC_KEY"`
353+
354+
// Comma-separated list of host:<base64ed user:password> pairs to authenticate against docker registries
355+
GitpodImageAuth string `env:"GITPOD_IMAGE_AUTH"`
353356
}
354357

355358
// WorkspaceGitpodToken is a list of tokens that should be added to supervisor's token service.

components/supervisor/pkg/supervisor/docker.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,13 @@ func listenToDockerSocket(parentCtx context.Context, term *terminal.Mux, cfg *Co
191191
}
192192

193193
cmd := exec.CommandContext(ctx, "/usr/bin/docker-up")
194-
cmd.Env = append(os.Environ(), "LISTEN_FDS=1")
194+
// TODO(gpl): Why are we using os.Environ() in the first place, and not childProcEnvvars?
195+
// Might be an oversight from times when we still passed all dockerupEnv vars as Pod dockerupEnv vars... otherwise I don't see why not use [] instead.
196+
// But I'm not sure, so sticking with the slightly more verbose version here.
197+
dockerupEnv := os.Environ()
198+
dockerupEnv = append(dockerupEnv, fmt.Sprintf("GITPOD_IMAGE_AUTH=%s", cfg.GitpodImageAuth))
199+
dockerupEnv = append(dockerupEnv, "LISTEN_FDS=1")
200+
cmd.Env = dockerupEnv
195201
cmd.ExtraFiles = []*os.File{socketFD}
196202
cmd.Stdout = stdout
197203
cmd.Stderr = stderr

0 commit comments

Comments
 (0)