cleanup(#1177): unify manager socket path, remove dead manager-name branches, rename ensure_manager
This commit is contained in:
parent
3bb45acd87
commit
eb3c6cd0c4
8 changed files with 36 additions and 41 deletions
|
|
@ -168,17 +168,12 @@ pub fn write_payload(agent: &str, host_path: &Path, message: &str) -> Result<(),
|
|||
}
|
||||
|
||||
/// Container-visible state prefix the caller's `file_path` must live
|
||||
/// under. Every agent sees its state at `/agents/<container>/state/`
|
||||
/// under. Every agent sees its state at `/agents/<name>/state/`
|
||||
/// (see `lifecycle::set_nspawn_flags`). Auto-file paths use the same
|
||||
/// prefix so the round-trip is symmetric. The manager logical name
|
||||
/// maps to its container name (`root`) per `lifecycle::MANAGER_NAME`.
|
||||
/// prefix so the round-trip is symmetric.
|
||||
#[must_use]
|
||||
pub fn container_state_prefix(agent: &str) -> String {
|
||||
if agent == hive_sh4re::MANAGER_AGENT {
|
||||
format!("/agents/{}/state/", crate::lifecycle::MANAGER_NAME)
|
||||
} else {
|
||||
format!("/agents/{agent}/state/")
|
||||
}
|
||||
format!("/agents/{agent}/state/")
|
||||
}
|
||||
|
||||
/// Map an agent-visible container path to the matching host path,
|
||||
|
|
|
|||
Loading…
Reference in a new issue