mirror of
https://github.com/containers/podman.git
synced 2025-11-02 06:37:09 +08:00
Improve error reporting on ssh readiness check Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
25 lines
821 B
Go
25 lines
821 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, 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
|
|
}
|