Skip to content

Commit

Permalink
Merge pull request #11234 from baude/v3.3fixmacospath
Browse files Browse the repository at this point in the history
fix gvproxy path search for macos
  • Loading branch information
openshift-ci[bot] authored Aug 16, 2021
2 parents a5adadf + 440188f commit 39cab79
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,15 @@ func CheckActiveVM() (bool, string, error) {
// startHostNetworking runs a binary on the host system that allows users
// to setup port forwarding to the podman virtual machine
func (v *MachineVM) startHostNetworking() error {
// TODO we may wish to configure the directory in containers common
binary := filepath.Join("/usr/libexec/podman/", machine.ForwarderBinaryName)
if _, err := os.Stat(binary); err != nil {
return err
// MacOS does not have /usr/libexec so we look in the executable
// paths.
binary, err := exec.LookPath(machine.ForwarderBinaryName)
if errors.Cause(err) == exec.ErrNotFound {
// Nothing was found, so now check /usr/libexec, else error out
binary = filepath.Join("/usr/libexec/podman/", machine.ForwarderBinaryName)
if _, err := os.Stat(binary); err != nil {
return err
}
}

// Listen on all at port 7777 for setting up and tearing
Expand Down

0 comments on commit 39cab79

Please sign in to comment.