Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl setup: an existing ruth keeps her permissions

declare_ruth stored the default set plus manage_root_agent over whatever ruth held, so a rerun dropped permissions granted since. It now reads her record and adds manage_root_agent only when it is missing, and writes nothing when she holds it. A new ruth still gets the defaults plus manage_root_agent.
This commit is contained in:
atlas 2026-11-08 14:12:04 +01:00 • committed by mara
commit 526cfbec1b

View file

@ -43,6 +43,18 @@ pub(crate) fn get(target: &Target, agent: &str) -> Result<()> {
Ok(())
}
/// The stored record of `agent`, printing nothing.
pub(crate) fn fetch(target: &Target, agent: &str) -> Result<Permissions> {
let uri = member(agent)?;
runtime()?.block_on(send(
target,
hyper::Method::GET,
&uri,
None::<&()>,
"permissions-get",
))
}
/// Run `swarmctl agent permissions set`: store the given permissions, which
/// replace the agent's record whole.
pub(crate) fn set(