fix(host_agent): a node the operator keeps drained stays drained through its maintenance (#5777)
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 1m23s
CI / unit (push) Successful in 1m28s
CI / publish (push) Successful in 17s

#5777 "Maintenance would make a node the operator keeps drained active after
its reboot". A swarm node already set to drain or pause, such as a manager
kept free of work, is no longer drained before its reboot or made active
after it. Its job only updates and reboots it, and back-in-service needs it
ready but not active.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 20:45:22 -04:00
co-authored by Claude Opus 5.5
parent c6b15b1cc6
commit 31a6cf09a9
4 changed files with 40 additions and 13 deletions
+5
View File
@@ -66,6 +66,11 @@ def test_a_host_is_back_once_posting_its_node_active_and_its_services_at_replica
services=[_svc("web", 1, 2), _svc("agent", 2, 3, mode="global")],
**kw) == "services below their replicas: web"
assert c.back_in_service(last_seen_at=NOW, node=_node(), services=[_svc("web", 2, 2)], **kw) is None
# A node the job didn't drain stays drained, as the operator keeps it.
assert c.back_in_service(last_seen_at=NOW, node=_node(availability="drain"),
services=[_svc("web", 1, 1)], expect_active=False, **kw) is None
assert "down" in c.back_in_service(last_seen_at=NOW, node=_node(status="down", availability="drain"),
services=[_svc("web", 1, 1)], expect_active=False, **kw)
def _run(**kw):