Skip to content

Commit

Permalink
fix: ssh access with remote profiles (#1092)
Browse files Browse the repository at this point in the history
Signed-off-by: Toma Puljak <[email protected]>
  • Loading branch information
Tpuljak authored Sep 12, 2024
1 parent 52cc61e commit a540533
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/workspace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var CreateCmd = &cobra.Command{
}

var tsConn *tsnet.Server
if target.Name != "local" {
if target.Name != "local" || activeProfile.Id != "default" {
tsConn, err = tailscale.GetConnection(&activeProfile)
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -406,7 +406,7 @@ func processGitURL(repoUrl string, apiClient *apiclient.APIClient, projects *[]a
}

func waitForDial(workspace *apiclient.Workspace, activeProfile *config.Profile, tsConn *tsnet.Server) error {
if workspace.Target == "local" {
if workspace.Target == "local" && (activeProfile != nil && activeProfile.Id == "default") {
err := config.EnsureSshConfigEntryAdded(activeProfile.Id, workspace.Id, workspace.Projects[0].Name)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/workspace/ssh-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var SshProxyCmd = &cobra.Command{
log.Fatal(err)
}

if workspace.Target == "local" {
if workspace.Target == "local" && profile.Id == "default" {
// If the workspace is local, we directly access the ssh port through the container
project := workspace.Projects[0]

Expand Down

0 comments on commit a540533

Please sign in to comment.