fix(gateway): try harder to detect Podman#1536
Conversation
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
b281fe7 to
6e7e986
Compare
|
/ok to test 6e7e986 |
7ae95dc to
9abd176
Compare
|
/ok to test 9abd176 |
PR Review StatusValidation: project-valid. The PR author is in Review findings:
E2E decision: this affects Podman/Docker driver auto-detection. After the review finding is addressed, Next state: |
|
It's true that the Docker driver can fail if Docker is selected and This change is scoped to Podman autodetection. Podman autodetection probes the same Podman-specific socket paths that the Podman driver will use by default, plus I think we should fix the Docker autodetect and socket selection in a separate change; Bollard's defaults aren't sufficient. And in that change we should do the same as this change does for Podman, keeping the auto-detection's candidate sockets and the client's actual socket selection aligned. |
PR Review StatusValidation: project-valid. The PR remains scoped to Podman autodetection and the author clarified that Docker-compatible socket selection should be handled in a separate Docker autodetect/socket-selection change. Review findings:
E2E decision: this affects Podman/Docker driver auto-detection, so Next state: |
|
Label |
Auto-detection previously treated Podman as available only when the podman CLI was visible on PATH. However, package manager services can run with a restricted PATH, which lets Docker be selected even when a Podman API socket is reachable. Additionally, podman may symlink /var/run/docker.sock to podman's machine unix socket, which would be incorrectly detected as Docker. Worse still: the podman machine may not even be running. This replaces the Podman binary check with a functional HTTP probe against the standard Podman socket paths. The probe requires /_ping to answer with a Libpod-Api-Version header before treating the socket as Podman, which lets the gateway select the embedded Podman driver only when the API is usable. Signed-off-by: Kris Hicks <khicks@nvidia.com>
9abd176 to
033aad8
Compare
Summary
Auto-detection previously treated Podman as available only when the podman CLI was visible on PATH. However, package manager services can run with a restricted PATH, which lets Docker be selected even when a Podman API socket is reachable. Additionally, podman may symlink /var/run/docker.sock to podman's machine unix socket, which would be incorrectly detected as Docker. Worse still: the podman machine may not even be running.
This replaces the Podman binary check with a functional HTTP probe against the standard Podman socket paths. The probe requires /_ping to answer with a Libpod-Api-Version header before treating the socket as Podman, which lets the gateway select the embedded Podman driver only when the API is usable.
Related Issue
Changes
podmanCLI is available or a standard Podman API socket is reachable.OPENSHELL_PODMAN_SOCKET,XDG_RUNTIME_DIR, Linux/run/user/{uid}, and macOS Podman machine socket paths.Testing
mise run pre-commitpassesAdditional validation:
Checklist