Skip to content

Commit

Permalink
Windows:RS5+ allow pulling uplevel images
Browse files Browse the repository at this point in the history
Signed-off-by: John Howard <jhoward@microsoft.com>
  • Loading branch information
John Howard committed Jun 7, 2019
1 parent b10cd5c commit 59d1597
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion distribution/pull_v2_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strconv"
"strings"

"github.com/Microsoft/hcsshim/osversion"
"github.com/containerd/containerd/platforms"
"github.com/docker/distribution"
"github.com/docker/distribution/manifest/manifestlist"
Expand Down Expand Up @@ -127,7 +128,8 @@ func checkImageCompatibility(imageOS, imageOSVersion string) error {
splitImageOSVersion := strings.Split(imageOSVersion, ".") // eg 10.0.16299.nnnn
if len(splitImageOSVersion) >= 3 {
if imageOSBuild, err := strconv.Atoi(splitImageOSVersion[2]); err == nil {
if imageOSBuild > int(hostOSV.Build) {
// As of RS5, we allow later images, but only when run as a Hyper-V isolated container.
if system.GetOSVersion().Build < osversion.RS5 && imageOSBuild > int(hostOSV.Build) {
errMsg := fmt.Sprintf("a Windows version %s.%s.%s-based image is incompatible with a %s host", splitImageOSVersion[0], splitImageOSVersion[1], splitImageOSVersion[2], hostOSV.ToString())
logrus.Debugf(errMsg)
return errors.New(errMsg)
Expand Down

0 comments on commit 59d1597

Please sign in to comment.