Skip to content

Commit

Permalink
Merge pull request #185 from cgwalters/status-err-rpmostree
Browse files Browse the repository at this point in the history
status: Fully ignore images with rpm-ostree changes
  • Loading branch information
cgwalters authored Nov 7, 2023
2 parents 4b3ad8e + 8f4df5f commit 3f4a538
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ fn boot_entry_from_deployment(
) -> Result<BootEntry> {
let repo = &sysroot.repo();
let (image, incompatible) = if let Some(origin) = deployment.origin().as_ref() {
if let Some(image) = get_image_origin(origin)? {
let incompatible = crate::utils::origin_has_rpmostree_stuff(origin);
let image = if incompatible {
// If there are local changes, we can't represent it as a bootc compatible image.
None
} else if let Some(image) = get_image_origin(origin)? {
let image = ImageReference::from(image);
let csum = deployment.csum();
let incompatible = crate::utils::origin_has_rpmostree_stuff(origin);
let imgstate = ostree_container::store::query_image_commit(repo, &csum)?;
let config = imgstate.configuration.as_ref();
let labels = config.and_then(labels_of_config);
Expand All @@ -129,18 +132,16 @@ fn boot_entry_from_deployment(
let version = config
.and_then(ostree_container::version_for_config)
.map(ToOwned::to_owned);
(
Some(ImageStatus {
image,
version,
timestamp,
image_digest: imgstate.manifest_digest,
}),
incompatible,
)
Some(ImageStatus {
image,
version,
timestamp,
image_digest: imgstate.manifest_digest,
})
} else {
(None, false)
}
None
};
(image, incompatible)
} else {
(None, false)
};
Expand Down

0 comments on commit 3f4a538

Please sign in to comment.