Merge pull request #30378 from mlaventure/fix-negative-size
Ensure proper value is used when computing reclaimable space
This commit is contained in:
commit
ee7682ebae
2 changed files with 5 additions and 2 deletions
|
@ -196,7 +196,10 @@ func (c *diskUsageImagesContext) Reclaimable() string {
|
||||||
c.AddHeader(reclaimableHeader)
|
c.AddHeader(reclaimableHeader)
|
||||||
for _, i := range c.images {
|
for _, i := range c.images {
|
||||||
if i.Containers != 0 {
|
if i.Containers != 0 {
|
||||||
used += i.Size
|
if i.VirtualSize == -1 || i.SharedSize == -1 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
used += i.VirtualSize - i.SharedSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ func (daemon *Daemon) Images(imageFilters filters.Args, all bool, withExtraAttrs
|
||||||
}
|
}
|
||||||
|
|
||||||
if withExtraAttrs {
|
if withExtraAttrs {
|
||||||
// Get Shared and Unique sizes
|
// Get Shared sizes
|
||||||
for img, newImage := range imagesMap {
|
for img, newImage := range imagesMap {
|
||||||
rootFS := *img.RootFS
|
rootFS := *img.RootFS
|
||||||
rootFS.DiffIDs = nil
|
rootFS.DiffIDs = nil
|
||||||
|
|
Loading…
Reference in a new issue