fix(macos): install passt for podman 5 rootless networking

podman 5 uses pasta as the default rootless network helper; podman 4
used slirp4netns. The spike was written against bookworm's podman 4.3.1,
so its package list never included passt — and the trixie bump (#451)
changed the default out from under it. Every nested container failed to
start with "could not find pasta", while image pulls and the service
itself worked, which disguised a missing dependency as a compat-API bug.

The bootstrap now checks for pasta up front so this fails with a clear
message instead of surfacing at the first `docker run`.

Note the sun_path fix in a12d2191 did NOT cause or cure this; that path
was over the 108-byte limit independently and would have bitten as soon
as attach was reached.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 19:20:27 -04:00
parent b0f012b8e6
commit 220620bfcc
3 changed files with 26 additions and 7 deletions
+14 -1
View File
@@ -108,7 +108,7 @@ class TestNestedContainersImage(unittest.TestCase):
calls.append((image, context, dockerfile))
text = Path(dockerfile).read_text(encoding="utf-8")
self.assertIn("FROM agent:base", text)
self.assertIn("fuse-overlayfs slirp4netns uidmap", text)
self.assertIn("fuse-overlayfs passt slirp4netns uidmap", text)
self.assertIn("USER node", text)
self.assertTrue((Path(context) / "nested-containers-init.sh").is_file())
@@ -116,6 +116,19 @@ class TestNestedContainersImage(unittest.TestCase):
self.assertEqual("agent:base-nested-containers", image)
self.assertEqual("agent:base-nested-containers", calls[0][0])
def test_installs_pasta_for_podman_5_rootless_networking(self) -> None:
"""podman 5 defaults to pasta where podman 4 used slirp4netns. Without
the passt package every nested container fails to start with "could
not find pasta" — pulls still work, which makes it look like a
compat-API bug rather than a missing dependency."""
seen: list[str] = []
def build(_image: str, _context: str, *, dockerfile: str) -> None:
seen.append(Path(dockerfile).read_text(encoding="utf-8"))
nested_containers.build_image("agent:base", build)
self.assertIn("passt", seen[0])
def test_strips_subordinate_ranges_so_podman_avoids_newuidmap(self) -> None:
"""The single-UID fallback is the entire reason podman works here.