summaryrefslogtreecommitdiff
path: root/pkg/machine
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-06-16 07:21:04 +0000
committerGitHub <noreply@github.com>2022-06-16 07:21:04 +0000
commita6226540e256895a0e3b6486a36fed0674a25169 (patch)
treecfe6921ffb6b6e3c94bce80fea43a187dfd1d819 /pkg/machine
parent31095349e394b4f5db0b76d3e4c5d05d3e6d05c3 (diff)
parent43e12c135b0de65a9000842539bc4afad82874d5 (diff)
downloadpodman-a6226540e256895a0e3b6486a36fed0674a25169.tar.gz
podman-a6226540e256895a0e3b6486a36fed0674a25169.tar.bz2
podman-a6226540e256895a0e3b6486a36fed0674a25169.zip
Merge pull request #14570 from Clivar/fix-windows-ssh-key-creation
Fix: Use absolute path to WSL binary to create ssh keys for `machine init` on Windows (Issue #14416)
Diffstat (limited to 'pkg/machine')
-rw-r--r--pkg/machine/keys.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/machine/keys.go b/pkg/machine/keys.go
index 15c1f73d8..45d9801cc 100644
--- a/pkg/machine/keys.go
+++ b/pkg/machine/keys.go
@@ -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