Skip to content

Commit c747c1e

Browse files
authored
Use WORKSPACE_CLUSTER_HOST for gp ssh output (#18289)
* Use WORKSPACE_CLUSTER_HOST for `gp ssh` output * Update ssh.go
1 parent 9bb400b commit c747c1e

File tree

1 file changed

+1
-6
lines changed
  • components/gitpod-cli/cmd

1 file changed

+1
-6
lines changed

components/gitpod-cli/cmd/ssh.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"context"
99
"fmt"
1010
"os"
11-
"strings"
1211
"time"
1312

1413
"github.com/gitpod-io/gitpod/gitpod-cli/pkg/gitpod"
@@ -35,12 +34,8 @@ See %s/user/keys for a guide on setting them up.
3534
return fmt.Errorf("cannot get workspace info: %w", err)
3635
}
3736

38-
host := strings.Replace(wsInfo.WorkspaceUrl, wsInfo.WorkspaceId, wsInfo.WorkspaceId+".ssh", -1)
39-
sshKeyHost := fmt.Sprintf(`%s@%s`, wsInfo.WorkspaceId, host)
40-
41-
sshCommand := fmt.Sprintf(`ssh '%s'`, sshKeyHost)
37+
sshCommand := fmt.Sprintf("ssh '%s@%s.ssh.%s'", wsInfo.WorkspaceId, wsInfo.WorkspaceId, wsInfo.WorkspaceClusterHost)
4238
fmt.Println(sshCommand)
43-
4439
return nil
4540
},
4641
}

0 commit comments

Comments
 (0)