Skip to content

Commit

Permalink
[server] Add config "experimantalNetwork" which translates to "WORKSP…
Browse files Browse the repository at this point in the history
…ACEKIT_USE_NETNS"
  • Loading branch information
geropl authored and csweichel committed Oct 26, 2021
1 parent 77bd66a commit 9b79e13
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/gitpod-protocol/data/gitpod-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
}
}
}
},
"experimentalNetwork": {
"type": "boolean",
"description": "Experimental network configuration in workspaces"
}
},
"additionalProperties": false
Expand Down
3 changes: 3 additions & 0 deletions components/gitpod-protocol/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ export interface WorkspaceConfig {
github?: GithubAppConfig;
vscode?: VSCodeConfig;

/** tailscale demo */
experimentalNetwork?: boolean;

/**
* Where the config object originates from.
*
Expand Down
7 changes: 7 additions & 0 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,13 @@ export class WorkspaceStarter {
vsxRegistryUrl.setValue(this.config.vsxRegistryUrl);
envvars.push(vsxRegistryUrl);

if (workspace.config.experimentalNetwork) {
const useNetnsVar = new EnvironmentVariable();
useNetnsVar.setName("WORKSPACEKIT_USE_NETNS");
useNetnsVar.setValue("true");
envvars.push(useNetnsVar);
}

const createGitpodTokenPromise = (async () => {
const scopes = this.createDefaultGitpodAPITokenScopes(workspace, instance);
const token = crypto.randomBytes(30).toString('hex');
Expand Down

0 comments on commit 9b79e13

Please sign in to comment.