From 98b29033a84b391b593f15016b8a96b1d42fe90a Mon Sep 17 00:00:00 2001 From: Chris Kyrouac Date: Thu, 11 Jul 2024 13:18:54 -0400 Subject: [PATCH] deploy: Return Deployment from deploy function This is preparation for the lifecycle bound image work. It will need access to the Deployment to read the bound image spec files. Signed-off-by: Chris Kyrouac --- lib/src/deploy.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/src/deploy.rs b/lib/src/deploy.rs index f0508f4fe..1f63d33ec 100644 --- a/lib/src/deploy.rs +++ b/lib/src/deploy.rs @@ -278,20 +278,21 @@ async fn deploy( image: &ImageState, origin: &glib::KeyFile, opts: Option>, -) -> Result<()> { +) -> Result { let stateroot = Some(stateroot); let opts = opts.unwrap_or_default(); // Copy to move into thread let cancellable = gio::Cancellable::NONE; - let _new_deployment = sysroot.stage_tree_with_options( - stateroot, - image.ostree_commit.as_str(), - Some(origin), - merge_deployment, - &opts, - cancellable, - )?; - Ok(()) + return sysroot + .stage_tree_with_options( + stateroot, + image.ostree_commit.as_str(), + Some(origin), + merge_deployment, + &opts, + cancellable, + ) + .map_err(Into::into); } #[context("Generating origin")]