Skip to content

Commit

Permalink
Merge pull request moby#30888 from estesp/moar-manifestlist-debug-output
Browse files Browse the repository at this point in the history
Add debug output to manifest list parsing
  • Loading branch information
AkihiroSuda authored Mar 3, 2017
2 parents 55b955d + 9a8cb93 commit 91f1143
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion distribution/pull_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,19 +672,23 @@ 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
// "features" and "variant" fields. These are not yet used.
// 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)
Expand Down

0 comments on commit 91f1143

Please sign in to comment.