distribution/pull_v2_unix.go
694df3ff
 // +build !windows
 
 package distribution
 
 import (
38aef56e
 	"runtime"
 
05bd0435
 	"github.com/docker/distribution"
 	"github.com/docker/distribution/context"
38aef56e
 	"github.com/docker/distribution/manifest/manifestlist"
 	"github.com/sirupsen/logrus"
694df3ff
 )
 
05bd0435
 func (ld *v2LayerDescriptor) open(ctx context.Context) (distribution.ReadSeekCloser, error) {
 	blobs := ld.repo.Blobs(ctx)
 	return blobs.Open(ctx, ld.digest)
 }
38aef56e
 
d98ecf2d
 func filterManifests(manifests []manifestlist.ManifestDescriptor, os string) []manifestlist.ManifestDescriptor {
38aef56e
 	var matches []manifestlist.ManifestDescriptor
 	for _, manifestDescriptor := range manifests {
d98ecf2d
 		if manifestDescriptor.Platform.Architecture == runtime.GOARCH && manifestDescriptor.Platform.OS == os {
38aef56e
 			matches = append(matches, manifestDescriptor)
 
d98ecf2d
 			logrus.Debugf("found match for %s/%s with media type %s, digest %s", os, runtime.GOARCH, manifestDescriptor.MediaType, manifestDescriptor.Digest.String())
38aef56e
 		}
 	}
 	return matches
 }