From 238abf6e2171f344bbb0ee2233a3e1f6b585ebb0 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 7 Sep 2020 11:26:11 +0200 Subject: 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 --- libpod/image/layer_tree.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libpod/image/layer_tree.go') 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 } -- cgit v1.2.3-54-g00ecf