mirror of https://github.com/containers/podman.git
Merge pull request #20478 from lstocchi/i20373
fix: check npipe when executing podman compose on wsl vm
This commit is contained in:
commit
642c0c798a
|
|
@ -184,12 +184,18 @@ func composeDockerHost() (string, error) {
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("inspecting machine: %w", err)
|
||||
}
|
||||
if info.ConnectionInfo.PodmanSocket == nil {
|
||||
return "", errors.New("socket of machine is not set")
|
||||
}
|
||||
if info.State != machine.Running {
|
||||
return "", fmt.Errorf("machine %s is not running but in state %s", item.Name, info.State)
|
||||
}
|
||||
if machineProvider.VMType() == machine.WSLVirt {
|
||||
if info.ConnectionInfo.PodmanPipe == nil {
|
||||
return "", errors.New("pipe of machine is not set")
|
||||
}
|
||||
return strings.Replace(info.ConnectionInfo.PodmanPipe.Path, `\\.\pipe\`, "npipe:////./pipe/", 1), nil
|
||||
}
|
||||
if info.ConnectionInfo.PodmanSocket == nil {
|
||||
return "", errors.New("socket of machine is not set")
|
||||
}
|
||||
return "unix://" + info.ConnectionInfo.PodmanSocket.Path, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue