Selaa lähdekoodia

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 2 vuotta sitten
vanhempi
commit
087cf6f238
1 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  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,
 				"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)
 			unpacked, err := platformImg.IsUnpacked(ctx, i.snapshotter)
 			if err != nil {
 			if err != nil {
 				logger.WithError(err).Warn("failed to check if image is unpacked")
 				logger.WithError(err).Warn("failed to check if image is unpacked")