c8d/load: Don't unpack pseudo images

Don't unpack image manifests which are not a real images that can't be
unpacked.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 4d3238dc0b)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-05-29 14:17:19 +02:00
parent 0b9d68f59d
commit 087cf6f238
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -145,6 +145,15 @@ func (i *ImageService) LoadImage(ctx context.Context, inTar io.ReadCloser, outSt
"manifest": platformImg.Target().Digest,
})
if isPseudo, err := platformImg.IsPseudoImage(ctx); isPseudo || err != nil {
if err != nil {
logger.WithError(err).Warn("failed to read manifest")
} else {
logger.Debug("don't unpack non-image manifest")
}
return nil
}
unpacked, err := platformImg.IsUnpacked(ctx, i.snapshotter)
if err != nil {
logger.WithError(err).Warn("failed to check if image is unpacked")