summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-01-29 14:54:24 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-01-29 14:54:24 +0100
commitc9fb6d16683bd8f75d74fe9df74386b23df29525 (patch)
treeda4b41c42d04b7d737e163f0bcf3309eaec6af1d
parentb2ae45cda18a9615c4ce61425531ce2c911701dc (diff)
downloadpodman-c9fb6d16683bd8f75d74fe9df74386b23df29525.tar.gz
podman-c9fb6d16683bd8f75d74fe9df74386b23df29525.tar.bz2
podman-c9fb6d16683bd8f75d74fe9df74386b23df29525.zip
history: fix size computing
Get the layer's size whether it relates to the first history entry or not. This fixes issues where the first entry would always be shown to be of size 0. Fixes: #4916 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
-rw-r--r--libpod/image/image.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 7ee8c45d7..355249b12 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -831,7 +831,8 @@ func (i *Image) History(ctx context.Context) ([]*History, error) {
id := "<missing>"
if x == numHistories {
id = i.ID()
- } else if layer != nil {
+ }
+ if layer != nil {
if !oci.History[x].EmptyLayer {
size = layer.UncompressedSize
}