Skip to content

Commit

Permalink
boundimage: Use high level deployment_fd helper
Browse files Browse the repository at this point in the history
This keeps things even simpler, it's the same thing we're doing
in `kargs.rs`.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jul 18, 2024
1 parent 4bf7312 commit ce33839
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/src/boundimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,9 @@ const BOUND_IMAGE_DIR: &str = "usr/lib/bootc-experimental/bound-images.d";

/// Given a deployment, pull all container images it references.
pub(crate) fn pull_bound_images(sysroot: &SysrootLock, deployment: &Deployment) -> Result<()> {
let sysroot_fd = crate::utils::sysroot_fd(&sysroot);
let sysroot_fd = Dir::reopen_dir(&sysroot_fd)?;
let deployment_root_path = sysroot.deployment_dirpath(&deployment);
let deployment_root = &sysroot_fd.open_dir(&deployment_root_path)?;

let bound_images = parse_spec_dir(&deployment_root, BOUND_IMAGE_DIR)?;
pull_images(deployment_root, bound_images)?;

Ok(())
let deployment_root = &crate::utils::deployment_fd(sysroot, deployment)?;
let bound_images = parse_spec_dir(deployment_root, BOUND_IMAGE_DIR)?;
pull_images(deployment_root, bound_images)
}

#[context("parse bound image spec dir")]
Expand Down

0 comments on commit ce33839

Please sign in to comment.