Skip to content

Commit 3e09c50

Browse files
committed
cli: Initialize bootc storage before upgrade --check
We had a report of `bootc upgrade --check` failing after a new install - this was using Anaconda with the legacy `ostreecontainer` verb that only knows about ostree. Hoist the image_exists_in_unified_storage() call (which ensures the bootc storage directory exists via get_ensure_imgstore()) above the opts.check branch so it runs for both --check and full upgrade paths. Relates: https://issues.redhat.com/browse/RHEL-153671 Assisted-by: OpenCode (Claude Opus 4) Signed-off-by: Colin Walters <walters@verbum.org>
1 parent f450cf3 commit 3e09c50

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

crates/lib/src/cli.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,11 @@ async fn upgrade(
11191119
return Ok(());
11201120
}
11211121

1122+
// Ensure the bootc storage directory is initialized; the --check path
1123+
// needs this for update_mtime() and the non-check path needs it for
1124+
// unified pull detection.
1125+
let use_unified = crate::deploy::image_exists_in_unified_storage(storage, imgref).await?;
1126+
11221127
if opts.check {
11231128
let ostree_imgref = imgref.clone().into();
11241129
let mut imp =
@@ -1144,9 +1149,6 @@ async fn upgrade(
11441149
}
11451150
}
11461151
} else {
1147-
// Auto-detect whether to use unified storage based on image presence in bootc storage
1148-
let use_unified = crate::deploy::image_exists_in_unified_storage(storage, imgref).await?;
1149-
11501152
let fetched = if use_unified {
11511153
crate::deploy::pull_unified(
11521154
repo,

0 commit comments

Comments
 (0)