Skip to content

Commit

Permalink
status: Fully ignore images with rpm-ostree changes
Browse files Browse the repository at this point in the history
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 <walters@verbum.org>
  • Loading branch information
cgwalters committed Nov 7, 2023
1 parent e8430d6 commit 8f4df5f
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 @@ -110,10 +110,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 @@ -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)
};
Expand Down

0 comments on commit 8f4df5f

Please sign in to comment.