mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Merge pull request #51128 from thaJeztah/28.x_backport_gcpolicy-invalid-calculations
[28.x backport] builder: use proper percentage calculations for default gc policy
This commit is contained in:
@@ -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