Skip to content

Commit 7b4c009

Browse files
composefs/export: Update image digest query format
After bootc/commit/49d753f996747a9b1f531abf35ba4e207cf4f020, composefs-rs saves config in the format `oci-config-sha256:`. Update to match the same Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent a276d75 commit 7b4c009

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

crates/lib/src/bootc_composefs/export.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ pub async fn export_repo_to_image(
5050

5151
let imginfo = get_imginfo(storage, &depl_verity, None).await?;
5252

53-
let config_digest = imginfo.manifest.config().digest().digest();
53+
// We want the digest in the form of "sha256:abc123"
54+
let config_digest = format!("{}", imginfo.manifest.config().digest());
5455

5556
let var_tmp =
5657
Dir::open_ambient_dir("/var/tmp", ambient_authority()).context("Opening /var/tmp")?;
@@ -60,7 +61,7 @@ pub async fn export_repo_to_image(
6061

6162
// Use composefs_oci::open_config to get the config and layer map
6263
let (config, layer_map) =
63-
open_config(&*booted_cfs.repo, config_digest, None).context("Opening config")?;
64+
open_config(&*booted_cfs.repo, &config_digest, None).context("Opening config")?;
6465

6566
// We can't guarantee that we'll get the same tar stream as the container image
6667
// So we create new config and manifest

crates/lib/src/bootc_composefs/soft_reboot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use cap_std_ext::cap_std::fs::Dir;
1616
use cap_std_ext::dirext::CapStdExtDirExt;
1717
use fn_error_context::context;
1818
use ostree_ext::systemd_has_soft_reboot;
19-
use rustix::mount::{unmount, UnmountFlags};
19+
use rustix::mount::{UnmountFlags, unmount};
2020
use std::{fs::create_dir_all, os::unix::process::CommandExt, path::PathBuf, process::Command};
2121

2222
const NEXTROOT: &str = "/run/nextroot";

0 commit comments

Comments
 (0)