Skip to content

Commit

Permalink
fixed pr changes for host
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerfong committed Feb 25, 2024
1 parent be0bd1c commit fa32414
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/open/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func runOpenCommand(t *terminal.Terminal, tstore OpenStore, wsIDOrName string, s

localIdentifier := workspace.GetLocalIdentifier()
if host {
localIdentifier += "-host"
localIdentifier = workspace.GetHostIdentifier()
}

Check warning on line 119 in pkg/cmd/open/open.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/open/open.go#L117-L119

Added lines #L117 - L119 were not covered by tests

err = res.Await()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func runShellCommand(t *terminal.Terminal, sstore ShellStore, workspaceNameOrID,

localIdentifier := workspace.GetLocalIdentifier()
if host {
localIdentifier += "-host"
localIdentifier = workspace.GetHostIdentifier()
}

Check warning on line 101 in pkg/cmd/shell/shell.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/shell/shell.go#L98-L101

Added lines #L98 - L101 were not covered by tests

sshName := string(localIdentifier)

Check warning on line 103 in pkg/cmd/shell/shell.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/shell/shell.go#L103

Added line #L103 was not covered by tests
Expand Down
4 changes: 4 additions & 0 deletions pkg/entity/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ func (w Workspace) GetLocalIdentifier() WorkspaceLocalID {
return w.createSimpleName()
}

func (w Workspace) GetHostIdentifier() WorkspaceLocalID {
return w.createSimpleName() + "-host"
}

func MakeIDSuffix(id string) string {
return id[len(id)-4:]
}
Expand Down

0 comments on commit fa32414

Please sign in to comment.