Watch
0
0
Fork
You've already forked hyperhive
0

add a default archetype, preselected by the clients

This commit is contained in:
atlas 2026-11-27 17:41:52 +01:00 • committed by mara
commit 8f7c45d40f

View file

@ -322,7 +322,7 @@ impl Actions for Live {
let target = self.target()?;
let hive = agent::parse_ident(hive, "hive")?;
if !exists {
agent::request_create(target, RUTH, &hive, None)?;
agent::request_create(target, RUTH, &hive, None, None)?;
}
let every = Duration::from_secs(2);
ensure_manager_permission(
@ -339,10 +339,11 @@ impl Actions for Live {
))
}
fn create_agent(&mut self, name: &str, hive: &str) -> Result<String> {
fn create_agent(&mut self, name: &str, hive: &str, custom: bool) -> Result<String> {
let name = agent::parse_ident(name, "agent name")?;
let hive = agent::parse_ident(hive, "hive")?;
let resp = agent::request_create(self.target()?, &name, &hive, None)?;
let archetype = (!custom).then_some("default");
let resp = agent::request_create(self.target()?, &name, &hive, archetype, None)?;
let mut said = format!(
"queued job node {} to deploy {name:?} to hive {hive:?}",
resp.node_id