2015-11-18 22:18:44 +00:00
// +build !windows
2018-02-05 21:05:59 +00:00
package distribution // import "github.com/docker/docker/distribution"
2015-11-18 22:18:44 +00:00
import (
2018-04-20 00:00:56 +00:00
"context"
2017-10-03 23:58:07 +00:00
"runtime"
2016-05-26 02:11:51 +00:00
"github.com/docker/distribution"
2017-10-03 23:58:07 +00:00
"github.com/docker/distribution/manifest/manifestlist"
"github.com/sirupsen/logrus"
2015-11-18 22:18:44 +00:00
)
2016-05-26 02:11:51 +00:00
func ( ld * v2LayerDescriptor ) open ( ctx context . Context ) ( distribution . ReadSeekCloser , error ) {
blobs := ld . repo . Blobs ( ctx )
return blobs . Open ( ctx , ld . digest )
}
2017-10-03 23:58:07 +00:00
2018-02-23 23:29:26 +00:00
func filterManifests ( manifests [ ] manifestlist . ManifestDescriptor , _ string ) [ ] manifestlist . ManifestDescriptor {
2017-10-03 23:58:07 +00:00
var matches [ ] manifestlist . ManifestDescriptor
for _ , manifestDescriptor := range manifests {
2018-02-23 23:29:26 +00:00
if manifestDescriptor . Platform . Architecture == runtime . GOARCH && manifestDescriptor . Platform . OS == runtime . GOOS {
2017-10-03 23:58:07 +00:00
matches = append ( matches , manifestDescriptor )
2018-02-23 23:29:26 +00:00
logrus . Debugf ( "found match for %s/%s with media type %s, digest %s" , runtime . GOOS , runtime . GOARCH , manifestDescriptor . MediaType , manifestDescriptor . Digest . String ( ) )
2017-10-03 23:58:07 +00:00
}
}
return matches
}
2018-02-15 21:17:27 +00:00
// checkImageCompatibility is a Windows-specific function. No-op on Linux
func checkImageCompatibility ( imageOS , imageOSVersion string ) error {
return nil
}