Skip to content

Commit 9577820

Browse files
committed
[server] Add DOCKERD_PROXY_ENABLED if feature flag "dockerd_proxy_enabled" is true
Tool: gitpod/catfood.gitpod.cloud
1 parent 2524442 commit 9577820

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

components/server/src/workspace/workspace-starter.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ export class WorkspaceStarter {
632632
}
633633

634634
// build workspace image
635-
const additionalAuth = await this.getAdditionalImageAuth(envVars);
635+
const additionalAuth = this.getAdditionalImageAuth(envVars);
636636
instance = await this.buildWorkspaceImage(
637637
{ span },
638638
user,
@@ -839,7 +839,7 @@ export class WorkspaceStarter {
839839
return undefined;
840840
}
841841

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

1496+
const isDockerdProxyEnabled = await getExperimentsClientForBackend().getValueAsync(
1497+
"dockerd_proxy_enabled",
1498+
false,
1499+
{ user, projectId: workspace.projectId, gitpodHost: this.config.hostUrl.url.toString() },
1500+
);
1501+
if (isDockerdProxyEnabled) {
1502+
const ev = new EnvironmentVariable();
1503+
ev.setName("DOCKERD_PROXY_ENABLED");
1504+
ev.setValue("true");
1505+
envvars.push(ev);
1506+
}
1507+
14961508
const portIndex = new Set<number>();
14971509
const ports = (workspace.config.ports || [])
14981510
.map((p) => {

0 commit comments

Comments
 (0)