Skip to content

Commit d0503f9

Browse files
committed
fix dashboard host for ssh test
1 parent 27f1cdd commit d0503f9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/test-ssh.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ jobs:
2323
- name: Test
2424
run: |
2525
go mod tidy
26-
ls /home/runner/work/saido/saido/ssh-key/ci/
2726
go test -v ./...

integration/integration_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,18 @@ func NewSSHForTest() driver.Driver {
3535
yamlPath := fmt.Sprintf("%s/%s", workingDir, "config-test.yaml")
3636
conf := config.LoadConfig(yamlPath)
3737
dashboardInfo := config.GetDashboardInfoConfig(conf)
38+
var host config.Host
39+
for ind := range dashboardInfo.Hosts {
40+
if dashboardInfo.Hosts[ind].Address == "0.0.0.0" {
41+
host = dashboardInfo.Hosts[ind]
42+
}
43+
}
44+
3845
return &driver.SSH{
39-
User: dashboardInfo.Hosts[0].Connection.Username,
40-
Host: dashboardInfo.Hosts[0].Address,
41-
Port: int(dashboardInfo.Hosts[0].Connection.Port),
42-
KeyFile: dashboardInfo.Hosts[0].Connection.PrivateKeyPath,
46+
User: host.Connection.Username,
47+
Host: host.Address,
48+
Port: int(host.Connection.Port),
49+
KeyFile: host.Connection.PrivateKeyPath,
4350
KeyPass: "",
4451
CheckKnownHosts: false,
4552
}

0 commit comments

Comments
 (0)