Browse Source

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>
Paweł Gronowski 2 years ago
parent
commit
4d3238dc0b
1 changed files with 9 additions and 0 deletions
  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")