Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/lib/src/bootc_composefs/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2937,6 +2937,7 @@ pub(crate) async fn setup_composefs_boot(
&root_setup.physical_root_path,
&deploy_id,
&crate::spec::ImageReference::from(state.target_imgref.clone()),
None,
true,
boot_type,
boot_digest,
Expand Down
8 changes: 8 additions & 0 deletions crates/lib/src/bootc_composefs/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,14 @@ pub(crate) async fn delete_composefs_deployment(
deployment_id
);

if super::origin::OriginChange::read(&storage.physical_root)?
.is_some_and(|pending| pending.deployment == deployment_id)
{
super::origin::cancel(&storage.physical_root)?;
println!("Cancelled pending origin change; kept the OS deployment");
return Ok(());
}

let host = get_composefs_status(storage, booted_cfs).await?;

let booted = host.require_composefs_booted()?;
Expand Down
5 changes: 5 additions & 0 deletions crates/lib/src/bootc_composefs/finalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ pub(crate) async fn composefs_backend_finalize(
return Ok(());
}

if let Some(pending) = super::origin::OriginChange::read_active(&storage.physical_root, &host)?
{
return pending.finalize(&storage.physical_root, &host);
}

let staged_composefs = staged_depl.composefs.as_ref().ok_or(anyhow::anyhow!(
"Staged deployment is not a composefs deployment"
))?;
Expand Down
4 changes: 4 additions & 0 deletions crates/lib/src/bootc_composefs/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ pub(crate) async fn composefs_gc(
continue;
}

if let Some(id) = deployment.container_image_id(storage)? {
live_container_images.insert(id);
}

// Keep the EROFS image as an additional root until all deployments
// have manifest -> image refs. Once a deployment is pulled with the
// new code, its EROFS image is reachable from the manifest and
Expand Down
1 change: 1 addition & 0 deletions crates/lib/src/bootc_composefs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub(crate) mod export;
pub(crate) mod finalize;
pub(crate) mod gc;
pub(crate) mod image;
pub(crate) mod origin;
pub(crate) mod progress;
pub(crate) mod repo;
pub(crate) mod rollback;
Expand Down
Loading
Loading