Commit eebb1fe
composefs: add pre-flight disk space check for native backend
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>1 parent 42e2db3 commit eebb1fe
File tree
5 files changed
+48
-9
lines changed- crates/lib/src
- bootc_composefs
- tmt
- plans
- tests/booted
5 files changed
+48
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
258 | 265 | | |
259 | 266 | | |
260 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
423 | 439 | | |
424 | 440 | | |
425 | 441 | | |
| |||
609 | 625 | | |
610 | 626 | | |
611 | 627 | | |
612 | | - | |
| 628 | + | |
613 | 629 | | |
614 | 630 | | |
615 | 631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| |||
1951 | 1955 | | |
1952 | 1956 | | |
1953 | 1957 | | |
1954 | | - | |
1955 | | - | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
1956 | 1975 | | |
1957 | 1976 | | |
1958 | 1977 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
0 commit comments