Merge pull request #30888 from estesp/moar-manifestlist-debug-output

Add debug output to manifest list parsing
This commit is contained in:
Akihiro Suda 2017-03-03 13:09:38 +09:00 committed by GitHub
commit 91f11437b6
1 changed files with 5 additions and 1 deletions

View File

@ -672,6 +672,7 @@ func (p *v2Puller) pullManifestList(ctx context.Context, ref reference.Named, mf
return "", "", err
}
logrus.Debugf("%s resolved to a manifestList object with %d entries; looking for a os/arch match", ref, len(mfstList.Manifests))
var manifestDigest digest.Digest
for _, manifestDescriptor := range mfstList.Manifests {
// TODO(aaronl): The manifest list spec supports optional
@ -679,12 +680,15 @@ func (p *v2Puller) pullManifestList(ctx context.Context, ref reference.Named, mf
// Once they are, their values should be interpreted here.
if manifestDescriptor.Platform.Architecture == runtime.GOARCH && manifestDescriptor.Platform.OS == runtime.GOOS {
manifestDigest = manifestDescriptor.Digest
logrus.Debugf("found match for %s/%s with media type %s, digest %s", runtime.GOOS, runtime.GOARCH, manifestDescriptor.MediaType, manifestDigest.String())
break
}
}
if manifestDigest == "" {
return "", "", errors.New("no supported platform found in manifest list")
errMsg := fmt.Sprintf("no matching manifest for %s/%s in the manifest list entries", runtime.GOOS, runtime.GOARCH)
logrus.Debugf(errMsg)
return "", "", errors.New(errMsg)
}
manSvc, err := p.repo.Manifests(ctx)