Skip to content

fix(gateway): try harder to detect Podman#1536

Open
krishicks wants to merge 1 commit into
mainfrom
hicks/podman-autodetect
Open

fix(gateway): try harder to detect Podman#1536
krishicks wants to merge 1 commit into
mainfrom
hicks/podman-autodetect

Conversation

@krishicks
Copy link
Copy Markdown
Collaborator

@krishicks krishicks commented May 22, 2026

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

  • Detect Podman when either the podman CLI is available or a standard Podman API socket is reachable.
  • Add Podman socket candidate probing for OPENSHELL_PODMAN_SOCKET, XDG_RUNTIME_DIR, Linux /run/user/{uid}, and macOS Podman machine socket paths.
  • Add/update unit tests for Podman socket candidate selection and reachable Unix socket detection.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Additional validation:

  • Built and ran current and previous gateway binaries with a restricted PATH; current commit selected Podman, previous commit selected Docker.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 22, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@krishicks
Copy link
Copy Markdown
Collaborator Author

I have read the DCO document and I hereby sign the DCO.

@krishicks
Copy link
Copy Markdown
Collaborator Author

recheck

@krishicks krishicks force-pushed the hicks/podman-autodetect branch from 00e2763 to b281fe7 Compare May 22, 2026 21:42
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>
@krishicks krishicks force-pushed the hicks/podman-autodetect branch from b281fe7 to 6e7e986 Compare May 22, 2026 23:22
@drew
Copy link
Copy Markdown
Collaborator

drew commented May 23, 2026

/ok to test 6e7e986

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants