Skip to content

Commit

Permalink
[server] Add DOCKERD_PROXY_ENABLED if feature flag "dockerd_proxy_ena…
Browse files Browse the repository at this point in the history
…bled" is true

Tool: gitpod/catfood.gitpod.cloud
  • Loading branch information
geropl committed Jan 30, 2025
1 parent 2524442 commit 9577820
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export class WorkspaceStarter {
}

// build workspace image
const additionalAuth = await this.getAdditionalImageAuth(envVars);
const additionalAuth = this.getAdditionalImageAuth(envVars);
instance = await this.buildWorkspaceImage(
{ span },
user,
Expand Down Expand Up @@ -839,7 +839,7 @@ export class WorkspaceStarter {
return undefined;
}

private async getAdditionalImageAuth(envVars: ResolvedEnvVars): Promise<Map<string, string>> {
private getAdditionalImageAuth(envVars: ResolvedEnvVars): Map<string, string> {
const res = new Map<string, string>();
const imageAuth = envVars.workspace.find((e) => e.name === EnvVar.GITPOD_IMAGE_AUTH_ENV_VAR_NAME);
if (!imageAuth) {
Expand Down Expand Up @@ -1493,6 +1493,18 @@ export class WorkspaceStarter {
envvars.push(ev);
})();

const isDockerdProxyEnabled = await getExperimentsClientForBackend().getValueAsync(
"dockerd_proxy_enabled",
false,
{ user, projectId: workspace.projectId, gitpodHost: this.config.hostUrl.url.toString() },
);
if (isDockerdProxyEnabled) {
const ev = new EnvironmentVariable();
ev.setName("DOCKERD_PROXY_ENABLED");
ev.setValue("true");
envvars.push(ev);
}

const portIndex = new Set<number>();
const ports = (workspace.config.ports || [])
.map((p) => {
Expand Down

0 comments on commit 9577820

Please sign in to comment.