mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Ensure proper value is used when computing reclaimable space
When Size was reverted to be equal to VirtualSize, the df command
formatter was not correctly updated to account for the change.
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
(cherry picked from commit dcc1b4baf6
)
Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
parent
0c16980468
commit
b9ee1c6880
2 changed files with 5 additions and 2 deletions
|
@ -192,7 +192,10 @@ func (c *diskUsageImagesContext) Reclaimable() string {
|
|||
c.AddHeader(reclaimableHeader)
|
||||
for _, i := range c.images {
|
||||
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 {
|
||||
// Get Shared and Unique sizes
|
||||
// Get Shared sizes
|
||||
for img, newImage := range imagesMap {
|
||||
rootFS := *img.RootFS
|
||||
rootFS.DiffIDs = nil
|
||||
|
|
Loading…
Reference in a new issue