Skip to content

Commit 06be8fb

Browse files
committed
upgrade works...
1 parent 6ce79dc commit 06be8fb

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

crates/lib/src/deploy.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,16 @@ pub(crate) async fn prune_container_store(sysroot: &Storage) -> Result<()> {
327327
for deployment in deployments {
328328
let bound = crate::boundimage::query_bound_images_for_deployment(ostree, &deployment)?;
329329
all_bound_images.extend(bound.into_iter());
330+
// Also include the host image itself
331+
if let Some(host_image) = crate::status::boot_entry_from_deployment(ostree, &deployment)?
332+
.image
333+
.map(|i| i.image)
334+
{
335+
all_bound_images.push(crate::boundimage::BoundImage {
336+
image: crate::utils::imageref_to_container_ref(&host_image),
337+
auth_file: None,
338+
});
339+
}
330340
}
331341
// Convert to a hashset of just the image names
332342
let image_names = HashSet::from_iter(all_bound_images.iter().map(|img| img.image.as_str()));

crates/lib/src/podstorage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl CStorage {
311311
.names
312312
.iter()
313313
.flatten()
314-
.any(|name| !roots.contains(name.as_str()))
314+
.all(|name| !roots.contains(name.as_str()))
315315
{
316316
garbage.push(image.id);
317317
}

crates/lib/src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn imagestatus(
186186

187187
/// Given an OSTree deployment, parse out metadata into our spec.
188188
#[context("Reading deployment metadata")]
189-
fn boot_entry_from_deployment(
189+
pub(crate) fn boot_entry_from_deployment(
190190
sysroot: &SysrootLock,
191191
deployment: &ostree::Deployment,
192192
) -> Result<BootEntry> {

0 commit comments

Comments
 (0)