From 56bcc776791b1e1cbb6eb3379613c830a0a1a2ee Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Mon, 26 Aug 2019 11:31:33 -0700 Subject: [PATCH] Handle layers with the same digest in unpacker. Signed-off-by: Lantao Liu --- unpacker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unpacker.go b/unpacker.go index 89c395cbb..1dc8c1481 100644 --- a/unpacker.go +++ b/unpacker.go @@ -113,6 +113,12 @@ func (u *unpacker) unpack(ctx context.Context, config ocispec.Descriptor, layers if states[i].layer.Blob.Digest != layer.Digest { continue } + // Different layers may have the same digest. When that + // happens, we should continue marking the next layer + // as downloaded. + if states[i].downloaded { + continue + } states[i].downloaded = true break }