summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2020-01-10 10:26:43 -0600
committerbaude <bbaude@redhat.com>2020-01-10 13:06:26 -0600
commit986feef2e80cfaed7cbce0df4fd5d619bcffefd7 (patch)
tree61134dad4b2efdaa65dee6e7206e5ce20080302c /libpod
parentc3956b1974ce545446a443488497dfbc98dda1a8 (diff)
downloadpodman-986feef2e80cfaed7cbce0df4fd5d619bcffefd7.tar.gz
podman-986feef2e80cfaed7cbce0df4fd5d619bcffefd7.tar.bz2
podman-986feef2e80cfaed7cbce0df4fd5d619bcffefd7.zip
fix e2e test failure
it is possible for layers.names to be nil and we must account for that. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/image/image.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index c0baf2e00..bce10e24c 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -841,15 +841,17 @@ func (i *Image) History(ctx context.Context) ([]*History, error) {
delete(topLayerMap, layer.ID)
}
}
-
- allHistory = append(allHistory, &History{
+ h := History{
ID: id,
Created: oci.History[x].Created,
CreatedBy: oci.History[x].CreatedBy,
Size: size,
Comment: oci.History[x].Comment,
- Tags: layer.Names,
- })
+ }
+ if layer != nil {
+ h.Tags = layer.Names
+ }
+ allHistory = append(allHistory, &h)
if layer != nil && layer.Parent != "" && !oci.History[x].EmptyLayer {
layer, err = i.imageruntime.store.Layer(layer.Parent)