From 1a7d7cc0158af80f9ce7907ec6eb81c9f43388e0 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Tue, 7 Oct 2025 10:18:17 -0500 Subject: [PATCH] builder: use proper percentage calculations for default gc policy The default gc policy calculations based on percentage were calculated improperly. These were calculated correctly in buildkit, but the calculation method was not copied over correctly when updating the values. Signed-off-by: Jonathan A. Sternberg --- daemon/internal/builder-next/worker/gc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/internal/builder-next/worker/gc.go b/daemon/internal/builder-next/worker/gc.go index 49b7ce6f04..bbb85a00fd 100644 --- a/daemon/internal/builder-next/worker/gc.go +++ b/daemon/internal/builder-next/worker/gc.go @@ -72,6 +72,6 @@ func DefaultGCPolicy(p string, reservedSpace, maxUsedSpace, minFreeSpace int64) } func diskPercentage(dstat disk.DiskStat, percentage int64) int64 { - avail := dstat.Total / percentage + avail := dstat.Total * percentage / 100 return (avail/(1<<30) + 1) * 1e9 // round up }