Merge pull request #3583 from Random-Liu/handle-duplicated-layer

Handle layers with the same digest in unpacker.
This commit is contained in:
Derek McGowan 2019-08-26 13:08:19 -07:00 committed by GitHub
commit cde03a0a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}