priv: derive flake ref from agent name; WriteNspawnFlags takes flags only

This commit is contained in:
damocles 2026-06-01 17:15:06 +02:00 committed by mara
commit 89d0937473
3 changed files with 64 additions and 31 deletions

View file

@ -42,18 +42,12 @@ pub async fn kill_container(name: &str) -> Result<()> {
ok(call(&PrivRequest::KillContainer { name: name.to_owned() }).await?)
}
pub async fn update_container(name: &str, flake_ref: &str) -> Result<(String, String)> {
check(call(&PrivRequest::UpdateContainer {
name: name.to_owned(),
flake_ref: flake_ref.to_owned(),
}).await?)
pub async fn update_container(name: &str) -> Result<(String, String)> {
check(call(&PrivRequest::UpdateContainer { name: name.to_owned() }).await?)
}
pub async fn create_container(name: &str, flake_ref: &str) -> Result<(String, String)> {
check(call(&PrivRequest::CreateContainer {
name: name.to_owned(),
flake_ref: flake_ref.to_owned(),
}).await?)
pub async fn create_container(name: &str) -> Result<(String, String)> {
check(call(&PrivRequest::CreateContainer { name: name.to_owned() }).await?)
}
pub async fn destroy_container(name: &str) -> Result<()> {
@ -65,10 +59,10 @@ pub async fn list_containers() -> Result<String> {
Ok(stdout)
}
pub async fn write_nspawn_conf(container: &str, content: &str) -> Result<()> {
ok(call(&PrivRequest::WriteNspawnConf {
pub async fn write_nspawn_flags(container: &str, extra_nspawn_flags: &str) -> Result<()> {
ok(call(&PrivRequest::WriteNspawnFlags {
container: container.to_owned(),
content: content.to_owned(),
extra_nspawn_flags: extra_nspawn_flags.to_owned(),
}).await?)
}