fix(host_agent): a node the operator keeps drained stays drained through its maintenance (#5777)
#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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user