Skip to content

Commit 0b0ed10

Browse files
composefs-backend/state: Store target imgref
Instead of storing the source imgref in the .origin file, we store the target imgref Signed-off-by: Pragyan Poudyal <[email protected]>
1 parent ff42662 commit 0b0ed10

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

crates/lib/src/bootc_composefs/boot.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use crate::bootc_composefs::status::get_sorted_uki_boot_entries;
3838
use crate::composefs_consts::{TYPE1_ENT_PATH, TYPE1_ENT_PATH_STAGED};
3939
use crate::parsers::bls_config::{BLSConfig, BLSConfigType};
4040
use crate::parsers::grub_menuconfig::MenuEntry;
41-
use crate::spec::ImageReference;
4241
use crate::task::Task;
4342
use crate::{
4443
composefs_consts::{
@@ -990,11 +989,7 @@ pub(crate) fn setup_composefs_boot(
990989
write_composefs_state(
991990
&root_setup.physical_root_path,
992991
id,
993-
&ImageReference {
994-
image: state.source.imageref.name.clone(),
995-
transport: state.source.imageref.transport.to_string(),
996-
signature: None,
997-
},
992+
&crate::spec::ImageReference::from(state.target_imgref.clone()),
998993
false,
999994
boot_type,
1000995
boot_digest,

crates/lib/src/bootc_composefs/state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ pub(crate) fn write_composefs_state(
113113
boot_type: BootType,
114114
boot_digest: Option<String>,
115115
) -> Result<()> {
116-
let state_path = root_path.join(format!("{STATE_DIR_RELATIVE}/{}", deployment_id.to_hex()));
116+
let state_path = root_path
117+
.join(STATE_DIR_RELATIVE)
118+
.join(deployment_id.to_hex());
117119

118120
create_dir_all(state_path.join("etc"))?;
119121

0 commit comments

Comments
 (0)