Skip to content

Commit faa68a7

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 0c1cb6b commit faa68a7

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::{
@@ -981,11 +980,7 @@ pub(crate) fn setup_composefs_boot(
981980
write_composefs_state(
982981
&root_setup.physical_root_path,
983982
id,
984-
&ImageReference {
985-
image: state.source.imageref.name.clone(),
986-
transport: state.source.imageref.transport.to_string(),
987-
signature: None,
988-
},
983+
&crate::spec::ImageReference::from(state.target_imgref.clone()),
989984
false,
990985
boot_type,
991986
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)