Skip to content

Commit 8f4df5f

Browse files
committed
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 <[email protected]>
1 parent e8430d6 commit 8f4df5f

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

lib/src/status.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@ fn boot_entry_from_deployment(
110110
) -> Result<BootEntry> {
111111
let repo = &sysroot.repo();
112112
let (image, incompatible) = if let Some(origin) = deployment.origin().as_ref() {
113-
if let Some(image) = get_image_origin(origin)? {
113+
let incompatible = crate::utils::origin_has_rpmostree_stuff(origin);
114+
let image = if incompatible {
115+
// If there are local changes, we can't represent it as a bootc compatible image.
116+
None
117+
} else if let Some(image) = get_image_origin(origin)? {
114118
let image = ImageReference::from(image);
115119
let csum = deployment.csum();
116-
let incompatible = crate::utils::origin_has_rpmostree_stuff(origin);
117120
let imgstate = ostree_container::store::query_image_commit(repo, &csum)?;
118121
let config = imgstate.configuration.as_ref();
119122
let labels = config.and_then(labels_of_config);
@@ -127,18 +130,16 @@ fn boot_entry_from_deployment(
127130
let version = config
128131
.and_then(ostree_container::version_for_config)
129132
.map(ToOwned::to_owned);
130-
(
131-
Some(ImageStatus {
132-
image,
133-
version,
134-
timestamp,
135-
image_digest: imgstate.manifest_digest,
136-
}),
137-
incompatible,
138-
)
133+
Some(ImageStatus {
134+
image,
135+
version,
136+
timestamp,
137+
image_digest: imgstate.manifest_digest,
138+
})
139139
} else {
140-
(None, false)
141-
}
140+
None
141+
};
142+
(image, incompatible)
142143
} else {
143144
(None, false)
144145
};

0 commit comments

Comments
 (0)