diff --git a/test/cri-containerd/main_test.go b/test/cri-containerd/main_test.go index 5c362b1acd..62dba6a7cd 100644 --- a/test/cri-containerd/main_test.go +++ b/test/cri-containerd/main_test.go @@ -170,7 +170,16 @@ 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") } } @@ -187,7 +196,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") } }