summaryrefslogtreecommitdiff
path: root/libpod/image/layer_tree.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-09-07 11:26:11 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-09-07 11:28:58 +0200
commit238abf6e2171f344bbb0ee2233a3e1f6b585ebb0 (patch)
tree6ebb0ad845d3bc9809d8e47d9f6d200de66a3d8a /libpod/image/layer_tree.go
parentba8d0bb5e336e84aaf68148563e61558b5dc94f5 (diff)
downloadpodman-238abf6e2171f344bbb0ee2233a3e1f6b585ebb0.tar.gz
podman-238abf6e2171f344bbb0ee2233a3e1f6b585ebb0.tar.bz2
podman-238abf6e2171f344bbb0ee2233a3e1f6b585ebb0.zip
make image parent check more robust
Follow up on issue #7444 and make the parent checks more robust. We can end up with an incoherent storage when, for instance, a build has been killed. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'libpod/image/layer_tree.go')
-rw-r--r--libpod/image/layer_tree.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/libpod/image/layer_tree.go b/libpod/image/layer_tree.go
index 3699655fd..18101575e 100644
--- a/libpod/image/layer_tree.go
+++ b/libpod/image/layer_tree.go
@@ -32,7 +32,9 @@ func (t *layerTree) toOCI(ctx context.Context, i *Image) (*ociv1.Image, error) {
oci, exists := t.ociCache[i.ID()]
if !exists {
oci, err = i.ociv1Image(ctx)
- t.ociCache[i.ID()] = oci
+ if err == nil {
+ t.ociCache[i.ID()] = oci
+ }
}
return oci, err
}