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:
parent
44caa72c19
commit
526cfbec1b
1 changed files with 137 additions and 8 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue