diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-01-29 14:54:24 +0100 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-01-29 14:54:24 +0100 |
commit | c9fb6d16683bd8f75d74fe9df74386b23df29525 (patch) | |
tree | da4b41c42d04b7d737e163f0bcf3309eaec6af1d /libpod/image | |
parent | b2ae45cda18a9615c4ce61425531ce2c911701dc (diff) | |
download | podman-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>
Diffstat (limited to 'libpod/image')
-rw-r--r-- | libpod/image/image.go | 3 |
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 } |