Skip to content

Commit e485f47

Browse files
committed
choose username according to whether verb yaml
1 parent dcc6ec0 commit e485f47

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/entity/entity.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ type Workspace struct {
305305
ExecsV1 *ExecsV1 `json:"execsV1"`
306306
IDEConfig IDEConfig `json:"ideConfig"`
307307
SSHPort int `json:"sshPort"`
308+
VerbYaml string `json:"verbYaml"`
308309
// PrimaryApplicationId string `json:"primaryApplicationId,omitempty"`
309310
// LastOnlineAt string `json:"lastOnlineAt,omitempty"`
310311
// CreatedAt string `json:"createdAt,omitempty"`

pkg/ssh/sshconfigurer.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,17 @@ func makeSSHConfigEntryV2(workspace entity.Workspace, privateKeyPath string) (st
279279
}
280280
} else {
281281
hostname := workspace.GetHostname()
282+
var userName string
283+
if workspace.VerbYaml != "" {
284+
userName = "root"
285+
} else {
286+
userName = "ubuntu"
287+
}
282288
port := workspace.GetPort()
283289
entry = SSHConfigEntryV2{
284290
Alias: alias,
285291
IdentityFile: privateKeyPath,
286-
User: "ubuntu", // todo param-user
292+
User: userName, // todo param-user
287293
Dir: workspace.GetProjectFolderPath(),
288294
HostName: hostname,
289295
Port: port,

0 commit comments

Comments
 (0)