Skip to content

fix(isolation): let Podman workers deploy instead of failing on a fence they cannot hold - #635

Closed
GeiserX wants to merge 3 commits into
mainfrom
fix/fence-podman
Closed

GeiserX wants to merge 3 commits into
mainfrom
fix/fence-podman

Conversation

@GeiserX

@GeiserX GeiserX commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Problem

On a Podman worker the LAN fence cannot work, and the worker did not know that. Podman's Docker-compatible API drops the network options the fence relies on: the interface name (com.docker.network.bridge.name), masquerade off and inter-container traffic off. netavark then adds its own masquerade. So the network check failed on every fenced deploy. A fresh install defaults to fenced, which meant no bridge earner could be deployed on Podman at all.

Fix

The worker reads /version, and when the engine names itself Podman it resolves to a new unsupported mode, as the Desktop app already does:

  • Earners deploy on Podman's default network, without the fence. No helper runs and no network is created.
  • The fleet page says the worker runs on Podman and its earners can reach the LAN and the host. The isolation check gives the same reason.
  • Turning isolation on from the fleet page is refused with the reason.
  • With CASHPILOT_ISOLATION=on, a deploy is refused before the running container is touched, because the fence was asked for and cannot be given.
  • CASHPILOT_ISOLATION=off and CASHPILOT_CONTAINER_NETWORK still take precedence. The .isolation_on marker is not written in this mode.
  • An engine that does not answer /version is taken for Docker, so the fence's own checks still apply.

docs/isolation.md and docs/isolation-check.md now say Podman is detected and not fenced, where before they said "not tested".

Tests

TestPodman in tests/test_lan_fence.py covers detection from a real Podman 5 /version shape, mode resolution, the deploy path (default network, no helper), the refusal under on, the periodic check, the refused switch and the isolation-check wording. Against main, 12 of the 13 fail. The one that passes is the case where an engine that does not answer is taken for Docker, and main does that anyway.

Desktop needs nothing: it already has this behaviour (isPodman and FenceModeUnsupported in internal/runtime/lanfence.go). This PR brings the web worker in line with it.

Not checked against a live Podman engine. Detection relies on Podman's documented /version component name, "Podman Engine".

…ce they cannot hold

Podman's Docker-compatible API drops the network options the fence relies
on (the interface name, masquerade off, inter-container traffic off), so on
a Podman worker every fenced deploy failed the network check, and a fresh
install defaults to fenced.

The worker now detects Podman from /version and resolves to a new
unsupported mode: earners deploy on Podman's default network, the fleet page
and the isolation check say they are not fenced, and turning isolation on is
refused with the reason. With CASHPILOT_ISOLATION=on a deploy is refused
before the running container is touched, since the fence was asked for.
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4f339d9 and dcfee5a.

Files selected for processing: 6

  • app/isolation_check.py
  • app/lan_fence.py
  • app/templates/fleet.html
  • docs/isolation-check.md
  • docs/isolation.md
  • tests/test_lan_fence.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.98%. Comparing base (4f339d9) to head (dcfee5a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #635   +/-   ##
=======================================
  Coverage   93.97%   93.98%           
=======================================
  Files          74       74           
  Lines       15678    15699   +21     
=======================================
+ Hits        14733    14754   +21     
  Misses        945      945           
Files with missing lines Coverage Δ
app/isolation_check.py 95.61% <100.00%> (+0.02%) ⬆️
app/lan_fence.py 91.59% <100.00%> (+0.34%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GeiserX

GeiserX commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Landed in #653 (f681889), which combined this fix with the others into one release.

@GeiserX GeiserX closed this Nov 7, 2026
@GeiserX
GeiserX deleted the fix/fence-podman branch November 7, 2026 21:41
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.

1 participant