mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00

Also addresses a number of issues: - StopHostNetworking isn't plumbed, win-sshproxy leaks on hyperv - Wait api and print output doesn't work properly on Windows - API forwarding doesn't work on WSL - Terminal corruption with after start/stop on Windows - Gvproxy is forcefully killed vs gracefully quit - Switching rootful/rootless does not update /var/run/docker.sock on the guest - File already closed error on init - HyperV backend is publishing Unix sockets when it should be named pipes - User-mode networking doesn't always work - Stop state outside of lock boundaries - WSL blocks parallel machined (should be supported) [NO NEW TESTS NEEDED] Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
25 lines
772 B
Go
25 lines
772 B
Go
package shim
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/containers/podman/v5/pkg/machine"
|
|
"github.com/containers/podman/v5/pkg/machine/define"
|
|
)
|
|
|
|
func setupMachineSockets(name string, dirs *define.MachineDirs) ([]string, string, machine.APIForwardingState, error) {
|
|
machinePipe := machine.ToDist(name)
|
|
if !machine.PipeNameAvailable(machinePipe) {
|
|
return nil, "", 0, fmt.Errorf("could not start api proxy since expected pipe is not available: %s", machinePipe)
|
|
}
|
|
sockets := []string{machine.NamedPipePrefix + machinePipe}
|
|
state := machine.MachineLocal
|
|
|
|
if machine.PipeNameAvailable(machine.GlobalNamedPipe) {
|
|
sockets = append(sockets, machine.NamedPipePrefix+machine.GlobalNamedPipe)
|
|
state = machine.DockerGlobal
|
|
}
|
|
|
|
return sockets, sockets[len(sockets)-1], state, nil
|
|
}
|