From 8900e3c758457785b121368ce832946634b9da00 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 17 May 2018 15:47:33 -0700 Subject: [PATCH] builder: patch incomplete download handling Signed-off-by: Tonis Tiigi --- builder/builder-next/adapters/containerimage/pull.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builder/builder-next/adapters/containerimage/pull.go b/builder/builder-next/adapters/containerimage/pull.go index 64a53753f6..3e6cc75a3c 100644 --- a/builder/builder-next/adapters/containerimage/pull.go +++ b/builder/builder-next/adapters/containerimage/pull.go @@ -497,7 +497,10 @@ func (ld *layerDescriptor) Download(ctx context.Context, progressOutput pkgprogr refKey := remotes.MakeRefKey(ctx, ld.desc) + ld.is.ContentStore.Abort(ctx, refKey) + if err := content.WriteBlob(ctx, ld.is.ContentStore, refKey, rc, ld.desc.Size, ld.desc.Digest); err != nil { + ld.is.ContentStore.Abort(ctx, refKey) return nil, 0, err }