Files
podman/pkg/machine/shim/networking_windows.go
Jason T. Greene e58cb97de1 Change API socket to be machine name isolated
- Fixes conflicts such as removal of second machine deleting a socket of a
  the first machine while it's running
- Move API socket into runtime directory for consistency
- Add API and gvproxy sockets to removal list
- Cleanup related logic

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-03-13 13:28:14 -05:00

27 lines
954 B
Go

package shim
import (
"fmt"
"github.com/containers/podman/v5/pkg/machine"
"github.com/containers/podman/v5/pkg/machine/define"
"github.com/containers/podman/v5/pkg/machine/env"
"github.com/containers/podman/v5/pkg/machine/vmconfigs"
)
func setupMachineSockets(mc *vmconfigs.MachineConfig, dirs *define.MachineDirs) ([]string, string, machine.APIForwardingState, error) {
machinePipe := env.WithPodmanPrefix(mc.Name)
if !machine.PipeNameAvailable(machinePipe, machine.MachineNameWait) {
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, machine.GlobalNameWait) {
sockets = append(sockets, machine.NamedPipePrefix+machine.GlobalNamedPipe)
state = machine.DockerGlobal
}
return sockets, sockets[len(sockets)-1], state, nil
}