Skip to content

Commit

Permalink
Merge pull request #14570 from Clivar/fix-windows-ssh-key-creation
Browse files Browse the repository at this point in the history
Fix: Use absolute path to WSL binary to create ssh keys for `machine init` on Windows (Issue #14416)
  • Loading branch information
openshift-ci[bot] authored Jun 16, 2022
2 parents 3109534 + 43e12c1 commit a622654
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/machine/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ func generatekeysPrefix(dir string, file string, passThru bool, prefix ...string
args := append([]string{}, prefix[1:]...)
args = append(args, sshCommand...)
args = append(args, file)
cmd := exec.Command(prefix[0], args...)

binary, err := exec.LookPath(prefix[0])
if err != nil {
return err
}
binary, err = filepath.Abs(binary)
if err != nil {
return err
}
cmd := exec.Command(binary, args...)
cmd.Dir = dir
if passThru {
cmd.Stdin = os.Stdin
Expand Down

0 comments on commit a622654

Please sign in to comment.