mirror of
https://github.com/containers/podman.git
synced 2025-11-28 17:18:58 +08:00
Tremendous amount of changes in here, but all should amount to the same thing: changing Go import paths from v5 to v6. Also bumped go.mod to github.com/containers/podman/v6 and updated version to v6.0.0-dev. Signed-off-by: Matt Heon <mheon@redhat.com>
39 lines
1.2 KiB
Go
39 lines
1.2 KiB
Go
package shim
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/containers/podman/v6/pkg/machine"
|
|
"github.com/containers/podman/v6/pkg/machine/define"
|
|
"github.com/containers/podman/v6/pkg/machine/env"
|
|
sc "github.com/containers/podman/v6/pkg/machine/sockets"
|
|
"github.com/containers/podman/v6/pkg/machine/vmconfigs"
|
|
)
|
|
|
|
func setupMachineSockets(mc *vmconfigs.MachineConfig, _ *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
|
|
}
|
|
|
|
hostSocket, err := mc.APISocket()
|
|
if err != nil {
|
|
return nil, "", 0, err
|
|
}
|
|
|
|
hostURL, err := sc.ToUnixURL(hostSocket)
|
|
if err != nil {
|
|
return nil, "", 0, err
|
|
}
|
|
sockets = append(sockets, hostURL.String())
|
|
|
|
return sockets, sockets[len(sockets)-2], state, nil
|
|
}
|