Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Jul 18, 2023
1 parent 1ccdb1f commit 2b4f50f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/local-ssh/ipc/extensionServiceServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,24 @@ class ExtensionServiceImpl implements ExtensionServiceImplementation {
});
}

const ownerToken = await this.sessionService.getAPI().getOwnerToken(actualWorkspaceId, _context.signal);

instanceId = rawWorkspace.status!.instance!.instanceId;

const workspaceUrl = new URL(wsData.workspaceUrl);
const workspaceHost = workspaceUrl.host.substring(workspaceUrl.host.indexOf('.') + 1);
let actualWorkspaceUrl = wsData.workspaceUrl;
if (workspaceId !== actualWorkspaceId) {
// Public api doesn't take into account "debug" workspaces, readd 'debug-' prefix
actualWorkspaceUrl = actualWorkspaceUrl.replace(actualWorkspaceId, workspaceId);
}
let ownerToken = '';
let workspaceHost = '';
let sshkey = '';
if (wsData.phase === 'running') {
ownerToken = await this.sessionService.getAPI().getOwnerToken(actualWorkspaceId, _context.signal);

const sshkey = wsData.phase === 'running' ? (await this.getWorkspaceSSHKey(ownerToken, actualWorkspaceUrl, _context.signal)) : '';
const workspaceUrl = new URL(wsData.workspaceUrl);
workspaceHost = workspaceUrl.host.substring(workspaceUrl.host.indexOf('.') + 1);
let actualWorkspaceUrl = wsData.workspaceUrl;
if (workspaceId !== actualWorkspaceId) {
// Public api doesn't take into account "debug" workspaces, readd 'debug-' prefix
actualWorkspaceUrl = actualWorkspaceUrl.replace(actualWorkspaceId, workspaceId);
}

sshkey = await this.getWorkspaceSSHKey(ownerToken, actualWorkspaceUrl, _context.signal);
}

return {
gitpodHost,
Expand Down

0 comments on commit 2b4f50f

Please sign in to comment.