Add support for Windows version filtering on pull#35090
Conversation
distribution/pull_v2_windows.go
Outdated
There was a problem hiding this comment.
Assuming the variable names are correct, they should be swapped in the prefix check:
strings.HasPrefix(actual, expected+".")30afe1c to
88df5be
Compare
distribution/pull_v2_unix.go
Outdated
There was a problem hiding this comment.
This TODO can be removed. Features is out. Variant is ARM only.
Update logic to choose manifest from manifest list to check for os version on Windows. Separate the logic for windows and unix to keep unix logic the same. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
88df5be to
38aef56
Compare
|
LGTM |
|
@dmcgowan Unfortunately, this introduces a significant regression. I'm going to back it out as part of #34642 which I've rebased on top of master. As an example, you can no longer pull winspector which is a multi-OS manifest image on an RS3 host as the Windows image in the manifest list is based on RS1, so it's skipped. The image runs just fine on RS3 as a Hyper-V container. @johnstep FYI |
|
|
Okay, that makes sense. Rather than filtering out images, we should only be changing the order to move the first compatible image to the top of the list. |
|
Thanks for finding this. See #35117 for a fix. |
|
What about a manifest list that covers two Windows versions to provide Docker images for RS1 and RS3 (without the need to have Hyper-V)? I've created an Insider version and pushed a manifest list (see StefanScherer/winspector#9 for details). |
|
@StefanScherer Thanks, yes, that is the scenario this change supports, by moving matching version(s) to the top of the manifest list before selecting the first image. Currently, the UBR ( |
|
I tried the Win10 Insider 17025 yesterday and tried to pull Windows image with a manifest list with RS1 + RS3 image. Docker engine then pulled the much bigger RS1 image (the first in the list). Should we enhance the selection to pick the closest os.version that is lower than the host os.version? Or would it be a best practise to provide manifest lists with multiple Windows images in a descending order (eg. RS5, RS3, RS1)? I used the order RS1 + RS3 as older Docker engines just pick the first Windows image from the manifest list and more people are still on RS1. |
|
@StefanScherer could you also open a separate issue / proposal for that (to prevent it from going lost)? (I think ordering came up in another discussion as well, but I'll have to search which one that was; may have been in the https://github.com/docker/distribution repository) |
Update logic to choose manifest from manifest list to check for os version on Windows. Separate the logic for windows and unix to keep unix logic the same.
Logic implemented:
os.version, choose first withoutos.versionos.versionand without, choose oneos.versionos.version, choose first withos.versionos.versionbased on major, minor, and build number for windows onlyping @johnstep @friism