Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ws2022 image/build to cri-containerd tests #1160

Merged
merged 5 commits into from
Dec 1, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions test/cri-containerd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,28 @@ func getWindowsNanoserverImage(build uint16) string {
return "mcr.microsoft.com/windows/nanoserver:2004"
case osversion.V20H2:
return "mcr.microsoft.com/windows/nanoserver:2009"
case osversion.V21H2Server:
return "mcr.microsoft.com/windows/nanoserver:ltsc2022"
default:
// Due to some efforts in improving down-level compatibility for Windows containers (see
// https://techcommunity.microsoft.com/t5/containers/windows-server-2022-and-beyond-for-containers/ba-p/2712487)
// the ltsc2022 image should continue to work on builds ws2022 and onwards. With this in mind,
// if there's no mapping for the host build, just use the Windows Server 2022 image.
if build > osversion.V21H2Server {
return "mcr.microsoft.com/windows/nanoserver:ltsc2022"
}
panic("unsupported build")
}
}

func getWindowsServerCoreImage(build uint16) string {
// Due to some efforts in improving down-level compatibility for Windows containers (see
// https://techcommunity.microsoft.com/t5/containers/windows-server-2022-and-beyond-for-containers/ba-p/2712487)
// the ltsc2022 image should continue to work on builds ws2022 and onwards. The panic for "unsupported build"
// should only be triggered if the user is on 21h1 or a build older than RS5 now.
if build > osversion.V21H2Server {
build = osversion.V21H2Server
}
switch build {
case osversion.RS5:
return "mcr.microsoft.com/windows/servercore:1809"
Expand All @@ -187,7 +203,16 @@ func getWindowsServerCoreImage(build uint16) string {
return "mcr.microsoft.com/windows/servercore:2004"
case osversion.V20H2:
return "mcr.microsoft.com/windows/servercore:2009"
case osversion.V21H2Server:
return "mcr.microsoft.com/windows/servercore:ltsc2022"
default:
// Due to some efforts in improving down-level compatibility for Windows containers (see
// https://techcommunity.microsoft.com/t5/containers/windows-server-2022-and-beyond-for-containers/ba-p/2712487)
// the ltsc2022 image should continue to work on builds ws2022 and onwards. With this in mind,
// if there's no mapping for the host build, just use the Windows Server 2022 image.
if build > osversion.V21H2Server {
return "mcr.microsoft.com/windows/servercore:ltsc2022"
}
panic("unsupported build")
}
}
Expand Down