diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-20 08:12:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 08:12:01 -0400 |
commit | 9c36d8458c1b4d4ab504a7ff54db87489cbb0254 (patch) | |
tree | dc0f07f0d83bec12fb8c69867d5a9e913541468d /pkg | |
parent | bc8d8737b760a1f42a9208c6067d2e163817d5f0 (diff) | |
parent | a4798ab4eff3dc0c8b7a863d96a1d39181dc3008 (diff) | |
download | podman-9c36d8458c1b4d4ab504a7ff54db87489cbb0254.tar.gz podman-9c36d8458c1b4d4ab504a7ff54db87489cbb0254.tar.bz2 podman-9c36d8458c1b4d4ab504a7ff54db87489cbb0254.zip |
Merge pull request #13885 from n1hility/fix-wsl-rootless
Respect "Rootful" when starting WSL API Forwarding
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/machine/wsl/machine.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/machine/wsl/machine.go b/pkg/machine/wsl/machine.go index 1da042f6a..dff7bfef9 100644 --- a/pkg/machine/wsl/machine.go +++ b/pkg/machine/wsl/machine.go @@ -830,7 +830,15 @@ func launchWinProxy(v *MachineVM) (bool, string, error) { return globalName, "", err } - dest := fmt.Sprintf("ssh://root@localhost:%d/run/podman/podman.sock", v.Port) + destSock := "/run/user/1000/podman/podman.sock" + forwardUser := v.RemoteUsername + + if v.Rootful { + destSock = "/run/podman/podman.sock" + forwardUser = "root" + } + + dest := fmt.Sprintf("ssh://%s@localhost:%d%s", forwardUser, v.Port, destSock) args := []string{v.Name, stateDir, pipePrefix + machinePipe, dest, v.IdentityPath} waitPipe := machinePipe if globalName { |