From c9fb6d16683bd8f75d74fe9df74386b23df29525 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 29 Jan 2020 14:54:24 +0100 Subject: [PATCH] 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 --- libpod/image/image.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpod/image/image.go b/libpod/image/image.go index 7ee8c45d78..355249b121 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 := "" if x == numHistories { id = i.ID() - } else if layer != nil { + } + if layer != nil { if !oci.History[x].EmptyLayer { size = layer.UncompressedSize }