Search gvproxy with config.FindHelperBinary()

Closes #11531

[NO TESTS NEEDED]

Signed-off-by: Hyeon Kim <simnalamburt@gmail.com>
This commit is contained in:
Hyeon Kim 2021-09-14 16:51:17 +09:00
parent b603c7a4b9
commit 072b061b4e
No known key found for this signature in database
GPG Key ID: 0F85F46EE242057F
1 changed files with 7 additions and 3 deletions

View File

@ -15,6 +15,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/containers/common/pkg/config"
"github.com/containers/podman/v3/pkg/machine" "github.com/containers/podman/v3/pkg/machine"
"github.com/containers/podman/v3/pkg/rootless" "github.com/containers/podman/v3/pkg/rootless"
"github.com/containers/podman/v3/utils" "github.com/containers/podman/v3/utils"
@ -627,9 +628,12 @@ func CheckActiveVM() (bool, string, error) {
// startHostNetworking runs a binary on the host system that allows users // startHostNetworking runs a binary on the host system that allows users
// to setup port forwarding to the podman virtual machine // to setup port forwarding to the podman virtual machine
func (v *MachineVM) startHostNetworking() error { func (v *MachineVM) startHostNetworking() error {
// TODO we may wish to configure the directory in containers common cfg, err := config.Default()
binary := filepath.Join("/usr/libexec/podman/", machine.ForwarderBinaryName) if err != nil {
if _, err := os.Stat(binary); err != nil { return err
}
binary, err := cfg.FindHelperBinary(machine.ForwarderBinaryName, false)
if err != nil {
return err return err
} }