Skip to content

Commit

Permalink
history: fix size computing
Browse files Browse the repository at this point in the history
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: containers#4916
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
  • Loading branch information
vrothberg committed Jan 29, 2020
1 parent b2ae45c commit c9fb6d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libpod/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c9fb6d1

Please sign in to comment.