Explorar o código

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 4d3238dc0b77d6df2b308d175cf1dec9d364dddf)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski %!s(int64=2) %!d(string=hai) anos
pai
achega
087cf6f238
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      daemon/containerd/image_exporter.go

+ 9 - 0
daemon/containerd/image_exporter.go

@@ -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")