Skip to content

Commit 9710cc4

Browse files
committed
wip
1 parent 6ce79dc commit 9710cc4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

crates/lib/src/image.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ pub(crate) async fn set_unified_entrypoint() -> Result<()> {
207207
// Pull the image from its original source into bootc storage using LBI machinery
208208
let imgstore = sysroot.get_ensure_imgstore()?;
209209

210-
let img_string = crate::utils::imageref_to_container_ref(imgref);
211-
212210
const SET_UNIFIED_JOURNAL_ID: &str = "1a0b9c8d7e6f5a4b3c2d1e0f9a8b7c6d";
213211
tracing::info!(
214212
message_id = SET_UNIFIED_JOURNAL_ID,
@@ -217,9 +215,19 @@ pub(crate) async fn set_unified_entrypoint() -> Result<()> {
217215
"Re-pulling booted image into bootc storage via unified path: {}",
218216
imgref_display
219217
);
220-
imgstore
221-
.pull(&img_string, crate::podstorage::PullMode::Always)
222-
.await?;
218+
219+
// If the image is already in containers-storage, copy it from the default storage
220+
// to bootc storage. Otherwise, pull it from the original source.
221+
if imgref.transport == "containers-storage" {
222+
imgstore
223+
.pull_from_host_storage(&imgref.image)
224+
.await?;
225+
} else {
226+
let img_string = crate::utils::imageref_to_container_ref(imgref);
227+
imgstore
228+
.pull(&img_string, crate::podstorage::PullMode::Always)
229+
.await?;
230+
}
223231

224232
// Optionally verify we can import from containers-storage by preparing in a temp importer
225233
// without actually importing into the main repo; this is a lightweight validation.

0 commit comments

Comments
 (0)