From 8f4df5fc9be5978d9892b7ea106dc87a7c822408 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 7 Nov 2023 09:54:42 -0500 Subject: [PATCH] status: Fully ignore images with rpm-ostree changes If we're querying a deployment that has a container base, but also has layered packages we'll error out because we'll try to find the layer base from the rpm-ostree generated merge commit. Just fully ignore deployments that have rpm-ostree changes. Signed-off-by: Colin Walters --- lib/src/status.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/src/status.rs b/lib/src/status.rs index a6fcf869f..65016a310 100644 --- a/lib/src/status.rs +++ b/lib/src/status.rs @@ -110,10 +110,13 @@ fn boot_entry_from_deployment( ) -> Result { 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); @@ -127,18 +130,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) };