Repository navigation
fix(updater): block updates that would stop WUDup's Docker endpoint - #888
Conversation
When DOCKER_HOST points at a network endpoint such as a socket proxy, the self-protection preflight now inspects the running containers in each stack's recreate scope and blocks the stack (docker-endpoint-recreate-blocked) if one of them serves that endpoint. Stopping it would cut WUDup off from Docker so it could not finish or roll back. Lookup failures fail closed; unix-socket DOCKER_HOST is unaffected and WUD itself stays updatable.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Reviewer's GuideThe PR extends updater preflight self-protection to detect and block recreate scopes that would terminate the container serving WUDup’s network-based DOCKER_HOST, using narrowly scoped container inspection and fail-closed error handling, with comprehensive tests and deployment documentation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|



Summary
In a production run, one stack's update scope included both WUD and the socket proxy that serves WUDup's
DOCKER_HOST(tcp://<proxy>:2375). When the stop phase took the proxy down, every later Docker call failed, and recovery and rollback both failed. The existing self-protection guard only covers WUDup's own image and container, so it missed this. This PR makes the updater preflight fail closed before any mutation when a recreate scope would stop or recreate the container serving WUDup's Docker endpoint.validate_self_update_scope(src/wudup/updater_preflight.py): whenDOCKER_HOSTistcp/http/https, inspect the running containers in each stack's scope and block the stack with the new reasondocker-endpoint-recreate-blockedand a plain-language message if the host matches a container name, network alias/DNS name, IP, or ID prefix. A failedcompose psor inspect also blocks the stack.DOCKER_HOSTis a network endpoint. Before this, the function returned early whenprotected_containerwas unset. A CLI run inside the WUDup container hits the same failure, and those runs now reuse the strictly verified scope.tests/test_python_web_jobs.pycovers a WUD error and a degraded snapshot.docker_endpoint_host/container_dns_names(container_identity.py) andDockerCli.container_dns_details, which uses a narrow inspect template, so the container env is never read.docs/wiki/webui-container.mddescribes the guard and its limits.Scope
preflight-skippedand stay pending; they are not applied in the same run.network_mode, or aDOCKER_CONTEXTendpoint. The docs say so. A same-named service on a network WUDup is not attached to can still be blocked (fails closed).Checklist
README.mdordocs/updated if install, deployment, config, or user-facing behavior changeddocs/examples/template.envordocs/examples/webui.env.exampleupdated if environment variables or example config changed: N/A - no new variablesCHANGELOG.mdedit needed outside release prepTest plan
tests/run-all.sh: N/A - ran the Python subset belowtests/run-all.sh --python(2191 passed, 1 skipped)ruff check .tests/test_python_update_from_wud_docker_endpoint.py(endpoint scope blocked before rewrite/pull/stop; WUD-only scope passes; unix socket unaffected; inspect, malformed output andcompose psfailures fail closed; WebUI path; dry-run)tests/test_python_update_from_wud_recreate.pytests/test-docker-update-from-wud.sh