fix(constructor): stop the disk pre-flight only when a full filesystem also lacks absolute room

The pre-flight stopped every deploy on a filesystem above SIZE_PERCENT_MAXIMUM_DISK_USAGE, which blocked a 1.8 TB workstation at 99 % with 30 GB free while a 145 GB runner was fine. A filesystem now fails only when it is above the percentage AND offers less than SIZE_GB_MINIMUM_DISK_FREE (20 GB): disk_usage_errors reads df's available column, the preflight_disk_usage filter passes the floor, and disk.yml runs df -P -k so the block unit stays KiB even under POSIXLY_CORRECT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-11-03 16:10:34 +01:00
1 parent 1ec96181b1
commit a3cb439a68
6 files changed
+73 -26

No files matched your search

@@ -36,13 +36,15 @@ class TestPreflightFilters(unittest.TestCase):
def test_disk_usage_reads_df_against_the_limit(self):
output = "Filesystem 1024-blocks Used Available Capacity Mounted on\n/dev/sda1 10 9 1 95% /\n"
self.assertEqual(
preflight_disk_usage(output, ["/"], "90"),
["/ lies on /, which is 95 % full (limit 90 %)"],
preflight_disk_usage(output, ["/"], "90", "20"),
[
"/ lies on /, which is 95 % full with 0.0 GB free (limits 90 % and 20 GB)"
],
)
def test_unparsable_df_output_is_a_filter_error(self):
with self.assertRaises(AnsibleFilterError):
preflight_disk_usage("header only\n", ["/"], 90)
preflight_disk_usage("header only\n", ["/"], 90, 20)
def test_the_cgroup_files_of_non_docker_listeners_are_listed(self):
self.assertEqual(