Browse code

Add debug output to manifest list parsing

Per request for more debug info on how the engine deals with
multi-platform "manifest list" images, this adds information about the
manifest list entries and whether it found an os/arch match, and the
digest of the match.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>

Phil Estes authored on 2017/02/10 09:13:57
Showing 1 changed files
... ...
@@ -658,6 +658,7 @@ func (p *v2Puller) pullManifestList(ctx context.Context, ref reference.Named, mf
658 658
 		return "", "", err
659 659
 	}
660 660
 
661
+	logrus.Debugf("%s resolved to a manifestList object with %d entries; looking for a os/arch match", ref, len(mfstList.Manifests))
661 662
 	var manifestDigest digest.Digest
662 663
 	for _, manifestDescriptor := range mfstList.Manifests {
663 664
 		// TODO(aaronl): The manifest list spec supports optional
... ...
@@ -665,12 +666,15 @@ func (p *v2Puller) pullManifestList(ctx context.Context, ref reference.Named, mf
665 665
 		// Once they are, their values should be interpreted here.
666 666
 		if manifestDescriptor.Platform.Architecture == runtime.GOARCH && manifestDescriptor.Platform.OS == runtime.GOOS {
667 667
 			manifestDigest = manifestDescriptor.Digest
668
+			logrus.Debugf("found match for %s/%s with media type %s, digest %s", runtime.GOOS, runtime.GOARCH, manifestDescriptor.MediaType, manifestDigest.String())
668 669
 			break
669 670
 		}
670 671
 	}
671 672
 
672 673
 	if manifestDigest == "" {
673
-		return "", "", errors.New("no supported platform found in manifest list")
674
+		errMsg := fmt.Sprintf("no matching manifest for %s/%s in the manifest list entries", runtime.GOOS, runtime.GOARCH)
675
+		logrus.Debugf(errMsg)
676
+		return "", "", errors.New(errMsg)
674 677
 	}
675 678
 
676 679
 	manSvc, err := p.repo.Manifests(ctx)