Skip to content

Commit

Permalink
deploy: Return Deployment from deploy function
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ckyrouac committed Jul 11, 2024
1 parent 5e9279d commit 98b2903
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,20 +278,21 @@ async fn deploy(
image: &ImageState,
origin: &glib::KeyFile,
opts: Option<ostree::SysrootDeployTreeOpts<'_>>,
) -> Result<()> {
) -> Result<Deployment> {
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")]
Expand Down

0 comments on commit 98b2903

Please sign in to comment.