summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-07 07:17:35 -0400
committerGitHub <noreply@github.com>2022-04-07 07:17:35 -0400
commitf838333b7e6fae09f3ee9116b84c6e6482367298 (patch)
tree8b72f4d6b0827256d4bcc10846c193ef88182d01
parentd7ff08aff46eea96a77b4e195e3497eecffd7d6c (diff)
parent356d5343445133f4071566a54f7b82a1e7eb9689 (diff)
downloadpodman-f838333b7e6fae09f3ee9116b84c6e6482367298.tar.gz
podman-f838333b7e6fae09f3ee9116b84c6e6482367298.tar.bz2
podman-f838333b7e6fae09f3ee9116b84c6e6482367298.zip
Merge pull request #13798 from n1hility/fix-docker-sock
Fix mac docker socket handling
-rw-r--r--pkg/machine/qemu/machine.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go
index 81bc98098..e849bae3f 100644
--- a/pkg/machine/qemu/machine.go
+++ b/pkg/machine/qemu/machine.go
@@ -1133,11 +1133,16 @@ func (v *MachineVM) setupAPIForwarding(cmd []string) ([]string, string, apiForwa
cmd = append(cmd, []string{"-forward-dest", destSock}...)
cmd = append(cmd, []string{"-forward-user", forwardUser}...)
cmd = append(cmd, []string{"-forward-identity", v.IdentityPath}...)
- link := socket.GetPath()
// The linking pattern is /var/run/docker.sock -> user global sock (link) -> machine sock (socket)
// This allows the helper to only have to maintain one constant target to the user, which can be
// repositioned without updating docker.sock.
+
+ link, err := v.userGlobalSocketLink()
+ if err != nil {
+ return cmd, socket.GetPath(), machineLocal
+ }
+
if !dockerClaimSupported() {
return cmd, socket.GetPath(), claimUnsupported
}
@@ -1176,6 +1181,16 @@ func (v *MachineVM) isIncompatible() bool {
return v.UID == -1
}
+func (v *MachineVM) userGlobalSocketLink() (string, error) {
+ path, err := machine.GetDataDir(v.Name)
+ if err != nil {
+ logrus.Errorf("Resolving data dir: %s", err.Error())
+ return "", err
+ }
+ // User global socket is located in parent directory of machine dirs (one per user)
+ return filepath.Join(filepath.Dir(path), "podman.sock"), err
+}
+
func (v *MachineVM) forwardSocketPath() (*MachineFile, error) {
sockName := "podman.sock"
path, err := machine.GetDataDir(v.Name)