fix(#962): top_level_agents_in delegates to children_of(MANAGER_NAME)

The previous parent=None heuristic was wrong — the manager is not
required to be the structural topology root (it can have a parent).
Delegate to children_of_in(MANAGER_NAME) directly; topology.rs is the
right place for this knowledge. Update comment in lifecycle.rs to say
"direct child of the manager" instead of "direct child of root".
This commit is contained in:
atlas 2026-06-01 19:00:19 +02:00 committed by mara
commit a4e0628ba1
2 changed files with 11 additions and 20 deletions

View file

@ -1149,9 +1149,10 @@ fn set_nspawn_flags(
}
// `can_manage_top_level_agents` role: additionally mount every
// top-level agent (direct child of root) as a virtual child. Enables
// recovery — a role holder can update a top-level agent's config even
// when that agent is down. Also grants RO access to /applied and /meta.
// top-level agent (direct child of the manager) as a virtual child.
// Enables recovery — a role holder can update a top-level agent's
// config even when that agent is down. Also grants RO access to
// /applied and /meta.
if crate::topology::has_role(
agent_name,
crate::topology::ROLE_CAN_MANAGE_TOP_LEVEL_AGENTS,