From c55820cad879616e5d219937f9f1caf5dac3ff99 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Mon, 23 Jan 2017 13:52:33 -0800 Subject: [PATCH] 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 Upstream-commit: 3494b518a5cb080da11096aac513b37cb545cc44 Component: cli --- components/cli/command/formatter/disk_usage.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/cli/command/formatter/disk_usage.go b/components/cli/command/formatter/disk_usage.go index ff1ab768c0..dc5eec41d7 100644 --- a/components/cli/command/formatter/disk_usage.go +++ b/components/cli/command/formatter/disk_usage.go @@ -196,7 +196,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 } }