Skip to content

Commit 3357d2a

Browse files
authored
Merge pull request #711 from cgwalters/minor-bound-bits2
boundimage: Use high level `deployment_fd` helper
2 parents 1fb8a15 + ce33839 commit 3357d2a

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

lib/src/boundimage.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,9 @@ const BOUND_IMAGE_DIR: &str = "usr/lib/bootc-experimental/bound-images.d";
2020

2121
/// Given a deployment, pull all container images it references.
2222
pub(crate) fn pull_bound_images(sysroot: &SysrootLock, deployment: &Deployment) -> Result<()> {
23-
let sysroot_fd = crate::utils::sysroot_fd(&sysroot);
24-
let sysroot_fd = Dir::reopen_dir(&sysroot_fd)?;
25-
let deployment_root_path = sysroot.deployment_dirpath(&deployment);
26-
let deployment_root = &sysroot_fd.open_dir(&deployment_root_path)?;
27-
28-
let bound_images = parse_spec_dir(&deployment_root, BOUND_IMAGE_DIR)?;
29-
pull_images(deployment_root, bound_images)?;
30-
31-
Ok(())
23+
let deployment_root = &crate::utils::deployment_fd(sysroot, deployment)?;
24+
let bound_images = parse_spec_dir(deployment_root, BOUND_IMAGE_DIR)?;
25+
pull_images(deployment_root, bound_images)
3226
}
3327

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

lib/src/utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pub(crate) fn sysroot_fd(sysroot: &ostree::Sysroot) -> BorrowedFd {
3131

3232
// Return a cap-std `Dir` type for a deployment.
3333
// TODO: in the future this should perhaps actually mount via composefs
34-
#[allow(unsafe_code)]
3534
pub(crate) fn deployment_fd(
3635
sysroot: &ostree::Sysroot,
3736
deployment: &ostree::Deployment,

0 commit comments

Comments
 (0)