mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
Replace FindExecutablePeer with FindHelperBinary
The WSL machine start was using the function FindExecutablePeer that
ignores user configuration (helper_binaries_dir). FindHelperBinary
instead is used when starting the machine for the rest of the providers
and honors user configuration.
This commit requires 4877783c37
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/containers/podman/v6/pkg/machine/env"
|
||||
"github.com/containers/podman/v6/pkg/machine/sockets"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.podman.io/common/pkg/config"
|
||||
"go.podman.io/storage/pkg/fileutils"
|
||||
)
|
||||
|
||||
@@ -132,7 +133,11 @@ func launchWinProxy(opts WinProxyOpts) (bool, string, error) {
|
||||
|
||||
globalName := PipeNameAvailable(GlobalNamedPipe, GlobalNameWait)
|
||||
|
||||
command, err := FindExecutablePeer(winSSHProxy)
|
||||
cfg, err := config.Default()
|
||||
if err != nil {
|
||||
return globalName, "", err
|
||||
}
|
||||
command, err := cfg.FindHelperBinary(winSSHProxy, false)
|
||||
if err != nil {
|
||||
return globalName, "", err
|
||||
}
|
||||
@@ -241,20 +246,6 @@ func sendQuit(tid uint32) {
|
||||
_, _, _ = postMessage.Call(uintptr(tid), WM_QUIT, 0, 0)
|
||||
}
|
||||
|
||||
func FindExecutablePeer(name string) (string, error) {
|
||||
exe, err := os.Executable()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
exe, err = EvalSymlinksOrClean(exe)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return filepath.Join(filepath.Dir(exe), name), nil
|
||||
}
|
||||
|
||||
func EvalSymlinksOrClean(filePath string) (string, error) {
|
||||
fileInfo, err := os.Lstat(filePath)
|
||||
if err != nil {
|
||||
|
||||
@@ -9,12 +9,12 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/containers/podman/v6/pkg/machine"
|
||||
"github.com/containers/podman/v6/pkg/machine/env"
|
||||
"github.com/containers/podman/v6/pkg/machine/vmconfigs"
|
||||
"github.com/containers/podman/v6/pkg/machine/wsl/wutil"
|
||||
"github.com/containers/podman/v6/pkg/specgen"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.podman.io/common/pkg/config"
|
||||
)
|
||||
|
||||
const gvForwarderPath = "/usr/libexec/podman/gvforwarder"
|
||||
@@ -78,7 +78,11 @@ func startUserModeNetworking(mc *vmconfigs.MachineConfig) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
exe, err := machine.FindExecutablePeer(gvProxy)
|
||||
cfg, err := config.Default()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
exe, err := cfg.FindHelperBinary(gvProxy, false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not locate %s, which is necessary for user-mode networking, please reinstall", gvProxy)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user