fix: report only the retired services a host actually had #9

Merged
christianmanivong merged 1 commits from fix/retired-removal-truthful into main 2026-10-08 13:29:20 +00:00
Owner

Closes #7.

docker rm -f exits 0 for a container that does not exist. The "Removing retired services" step therefore printed removed container netork-registry-1 on every deploy of every host, long after the container was gone. On 2026-10-08 two deploys to 172.22.8.50 in a row both reported it, while docker events showed no create or remove of that container in between.

Change: docker inspect first, so only an existing container is removed and reported. The volume loop is unchanged, because docker volume rm already fails for a missing volume. The README notes that the step reports only what it removed.

Tests: test_deploy_retired_services.py now runs the command the deploy sends against a fake docker whose rm -f succeeds for anything, like the real one:

  • no report when the container is absent;
  • a report when it exists.

All 28 tests pass and ruff is clean. On .50 the new loop prints nothing, as it should.

Closes #7. `docker rm -f` exits 0 for a container that does not exist. The "Removing retired services" step therefore printed `removed container netork-registry-1` on every deploy of every host, long after the container was gone. On 2026-10-08 two deploys to 172.22.8.50 in a row both reported it, while `docker events` showed no create or remove of that container in between. **Change:** `docker inspect` first, so only an existing container is removed and reported. The volume loop is unchanged, because `docker volume rm` already fails for a missing volume. The README notes that the step reports only what it removed. **Tests:** `test_deploy_retired_services.py` now runs the command the deploy sends against a fake `docker` whose `rm -f` succeeds for anything, like the real one: - no report when the container is absent; - a report when it exists. All 28 tests pass and ruff is clean. On .50 the new loop prints nothing, as it should.
christianmanivong added 1 commit 2026-10-08 13:22:58 +00:00
fix: report only the retired services a host actually had
CI / check (pull_request) Successful in 17s
1d99e401b9
`docker rm -f` exits 0 for a container that does not exist, so the
"Removing retired services" step printed "removed container
netork-registry-1" on every deploy of every host, long after the
container was gone. That read as something recreating the registry
each time, and it would hide the one deploy that really removed it.

Check with `docker inspect` first, so only an existing container is
removed and reported. The volume branch needed nothing: `docker volume
rm` already fails for a missing volume.

Closes #7
christianmanivong merged commit 6b334f42e2 into main 2026-10-08 13:29:20 +00:00
Sign in to join this conversation.