mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
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 <jonathan.sternberg@docker.com>
(cherry picked from commit 1a7d7cc015)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
0f040aa194
commit
dccf7c889c
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user