composefs: add pre-flight disk space check for native backend#2084
Open
shi2wei3 wants to merge 1 commit intobootc-dev:mainfrom
Open
composefs: add pre-flight disk space check for native backend#2084shi2wei3 wants to merge 1 commit intobootc-dev:mainfrom
shi2wei3 wants to merge 1 commit intobootc-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request successfully implements a pre-flight disk space check for the native composefs backend, extending the protection previously added for ostree and ostree+unified-storage backends. The changes include renaming check_disk_space_composefs to check_disk_space_unified for clarity, introducing a new check_disk_space_composefs for the native backend, and integrating these checks into the do_upgrade() and install_to_filesystem_impl() functions. Additionally, the relevant tmt tests have been updated to enable the pre-flight disk check for the composefs backend, ensuring proper validation. The code is well-structured and aligns with the stated objectives.
Johan-Liebert1
requested changes
Mar 23, 2026
The previous commit (7196079) added a pre-flight disk space check for the ostree and ostree+unified-storage backend paths. This commit extends the same protection to the native composefs backend. - Rename check_disk_space_composefs -> check_disk_space_unified for the ostree unified-storage path (uses PreparedImportMeta), to clarify that this variant is not used by the native composefs backend. - Add check_disk_space_composefs for the native composefs backend: sums layer sizes from the raw ImageManifest and calls fstatvfs on the composefs objects directory to verify available space before pulling. - Call check_disk_space_composefs in do_upgrade() (covers bootc upgrade and bootc switch on the native composefs backend), reusing the already-opened composefs repo from booted_cfs.repo. - Call check_disk_space_composefs in install_to_filesystem_impl() before initialize_composefs_repository() (covers bootc install --composefs-backend). Note: ensure_composefs_dir() is called first to create the objects directory if it does not yet exist on the fresh install target. - Enable the existing pre-flight disk check tmt test for the composefs backend (remove fixme_skip_if_composefs). Note: the check uses compressed layer sizes from the manifest, which is a lower bound of actual disk usage (composefs stores decompressed content). This is consistent with the ostree path and the broader container ecosystem, as uncompressed sizes are not available in the OCI manifest without downloading layers. Assisted-by: AI Signed-off-by: Wei Shi <wshi@redhat.com>
e1ac04d to
e9902d3
Compare
Johan-Liebert1
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous commit (7196079) added a pre-flight disk space check for the ostree and ostree+unified-storage backend paths. This commit extends the same protection to the native composefs backend.
Rename check_disk_space_composefs -> check_disk_space_unified for the ostree unified-storage path (uses PreparedImportMeta), to clarify that this variant is not used by the native composefs backend.
Add check_disk_space_composefs for the native composefs backend: sums layer sizes from the raw ImageManifest and calls fstatvfs on the composefs objects directory to verify available space before pulling.
Call check_disk_space_composefs in do_upgrade() (covers bootc upgrade and bootc switch on the native composefs backend).
Call check_disk_space_composefs in install_to_filesystem_impl() before initialize_composefs_repository() (covers bootc install --composefs-backend). Note: ensure_composefs_dir() is called first to create the objects directory if it does not yet exist on the fresh install target.
Enable the existing pre-flight disk check tmt test for the composefs backend (remove fixme_skip_if_composefs).
Assisted-by: AI