Skip to content

Commit dccf7c8

Browse files
jsternbergthaJeztah
authored andcommitted
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 <[email protected]> (cherry picked from commit 1a7d7cc) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 0f040aa commit dccf7c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • builder/builder-next/worker

builder/builder-next/worker/gc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ func DefaultGCPolicy(p string, reservedSpace, maxUsedSpace, minFreeSpace int64)
7272
}
7373

7474
func diskPercentage(dstat disk.DiskStat, percentage int64) int64 {
75-
avail := dstat.Total / percentage
75+
avail := dstat.Total * percentage / 100
7676
return (avail/(1<<30) + 1) * 1e9 // round up
7777
}

0 commit comments

Comments
 (0)