Skip to content

Conversation

Johan-Liebert1
Copy link
Collaborator

@Johan-Liebert1 Johan-Liebert1 commented Oct 13, 2025

Add a command to delete a composefs native deployment

Deleting a deployment would mean, deleting the EROFS image, the
bootloader entries for that deployment and deleting any objects in the
composefs repository that are only referenced by said deployment.

Also refactor some functions and add error contexts in some places

Draft PR for now as it requires containers/composefs-rs#188

Add a command to delete a composefs native deployment

Deleting a deployment would mean, deleting the EROFS image, the
bootloader entries for that deployment and deleting any objects in the
composefs repository that are only referenced by said deployment.

Also refactor some functions and add error contexts in some places

Signed-off-by: Pragyan Poudyal <[email protected]>
@bootc-bot bootc-bot bot requested a review from henrywang October 13, 2025 06:08
Delete the boot entries first, the image second and everything else
afterwards. If we fail to delete the boot entry, then there's no point
in deleting the image as the boot entry will still show, but there will
be no image.

We delete the objects at the end, as when we later perform a gc
operation and don't find the image that references these objects, we can
remove them then.

The state directory shouldn't have any effect on boot if the image
associated to it doesn't exist.

If the staged file /run/composefs/staged-deployment does exist, but we
have already deleted the staged image, the finalize service would fail
but that wouldn't break anything

Signed-off-by: Pragyan Poudyal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant