Skip to content

fix(server): keep Docker leftovers per installation and clean up after disabled ingress - #410

Open
PiquelChips wants to merge 4 commits into
mainfrom
g13/docker-leftovers
Open

PiquelChips wants to merge 4 commits into
mainfrom
g13/docker-leftovers

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

piqueld left Docker leftovers behind, or cleaned up other installations' resources on a shared Docker Engine:

  • NEW-13: disabling ingress removed the gateway containers but left their edge network.
  • NEW-7: health-probe configs were shared by content across installations, so a development daemon on the same engine could delete production's probe config between its publish and its service update.
  • REC-18: built images were untagged, so an operator's docker image prune deleted the ones restore and automatic rollback rely on.

What changes:

  • NEW-13: once every gateway container is gone, stop_gateway inspects the edge network, checks it is this installation's, and deletes it in an ingress_remove_network journal action. This is best-effort cleanup: a failure, or a network another installation owns, is journaled or logged as a warning, and ingress still disables and withdraws its routes and DNS records. Re-enabling ingress creates it again.
  • NEW-7: the probe config is named piqueld-health-probe-<hash of instance ID and probe binary> (instance IDs are too long to spell out within Swarm's name limit) and labelled with io.piqueld.instance. The runtime policy expects the service's own installation's probe. Cleanup removes only this installation's stale probe configs, plus unlabelled ones older daemons published, when no service mounts them.

    [!IMPORTANT]
    Upgrade note: the probe config's name changes, so every service with an HTTP health check rolls once, through its normal health-gated update, on the first deployment or repair after the upgrade. Installations sharing an engine stop removing each other's probe configs only once every one of them runs this version, since an older daemon still prunes by the shared label.

  • REC-18: after each build, piqueld tags the image piqueld-build/<instance ID>:<image ID hex>. docker image prune leaves tagged images. Cleanup still removes them by ID without force, which drops their single tag. Images built before the upgrade stay untagged, so docker image prune can still remove them until keep_deployments newer deployments replace them; the configuration docs say so. docker image prune --all still removes unused builds, and the configuration docs now say so.

Proof: just docker-test passes against an isolated engine (17 integration plus 4 real-Docker ingress tests). The integration suite now asserts that a build carries its tag, and that probe pruning keeps another installation's config while removing this installation's stale one and an unlabelled legacy one. A fake-engine test checks that disabled ingress deletes only its own edge network. The probe policy unit test rejects another installation's probe.

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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 45 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9791e388-31d7-49a0-b3a9-18c8e5ae48c5
Commits

Reviewing files that changed from the base of the PR and between a1127cf and 8a4e750.

Files selected for processing: 15

  • apps/piqueld/src/ingress/gateway.rs
  • apps/piqueld/src/ingress/tests/mod.rs
  • apps/piqueld/src/reconcile/images.rs
  • apps/piqueld/tests/docker_integration.rs
  • crates/piqueld-docker/src/configs.rs
  • crates/piqueld-docker/src/fake.rs
  • crates/piqueld-docker/src/lib.rs
  • crates/piqueld-docker/src/limited.rs
  • crates/piqueld-docker/src/policy.rs
  • crates/piqueld-docker/src/probe.rs
  • crates/piqueld-docker/src/resources.rs
  • crates/piqueld-docker/src/spec.rs
  • docs/dev/architecture/docker-reconciliation.md
  • docs/dev/architecture/ingress.md
  • docs/user/reference/configuration.md
  • 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

@PiquelChips
PiquelChips marked this pull request as ready for review November 10, 2026 15:56
@PiquelChips
PiquelChips force-pushed the g13/docker-leftovers branch 3 times, most recently from 53deac7 to 672bbd9 Compare November 12, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant