Skip to content

Commit

Permalink
Add "IdentitiesOnly" SSH option to fix running tests when known_hosts…
Browse files Browse the repository at this point in the history
… has multiple records

Signed-off-by: Yevhen Vydolob <[email protected]>
  • Loading branch information
evidolob committed Mar 19, 2024
1 parent 3f76a19 commit 80594f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func scp(src, dst string) error {
sshCmd := exec.Command("scp",
"-o", "UserKnownHostsFile=/dev/null",
"-o", "StrictHostKeyChecking=no",
"-o", "IdentitiesOnly=yes",
"-i", privateKeyFile,
"-P", strconv.Itoa(sshPort),
src,
Expand All @@ -204,6 +205,7 @@ func sshCommand(cmd ...string) *exec.Cmd {
sshCmd := exec.Command("ssh",
"-o", "UserKnownHostsFile=/dev/null",
"-o", "StrictHostKeyChecking=no",
"-o", "IdentitiesOnly=yes",
"-i", privateKeyFile,
"-p", strconv.Itoa(sshPort),
fmt.Sprintf("%[email protected]", ignitionUser), "--", strings.Join(cmd, " ")) // #nosec G204
Expand Down

0 comments on commit 80594f5

Please sign in to comment.