From c9408b383dede7f77a671e62a7085116cb3c6ad0 Mon Sep 17 00:00:00 2001 From: Danny Canter <36526702+dcantah@users.noreply.github.com> Date: Thu, 11 Nov 2021 10:47:15 -0800 Subject: [PATCH 1/2] Add 21H2 definitions to osversion package (#1205) * Add 21H2 definitions to osversion package This change adds three new definitions to the osversion package. All three definitions are all of the 21H2 builds across Windows 10, Windows Server and Windows 11, which all have different build numbers. The approach taken was to add a suffix to the definitions with Win10, Server and Win11 respectively. Signed-off-by: Daniel Canter (cherry picked from commit 3a8cd1e08c39c7efa59da94e349816da34a90359) Signed-off-by: Daniel Canter --- osversion/windowsbuilds.go | 9 +++++++++ .../Microsoft/hcsshim/osversion/windowsbuilds.go | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/osversion/windowsbuilds.go b/osversion/windowsbuilds.go index 49fb740cd1..75dce5d821 100644 --- a/osversion/windowsbuilds.go +++ b/osversion/windowsbuilds.go @@ -38,4 +38,13 @@ const ( // V21H1 corresponds to Windows Server 21H1 (semi-annual channel). V21H1 = 19043 + + // V21H2Win10 corresponds to Windows 10 (November 2021 Update). + V21H2Win10 = 19044 + + // V21H2Server corresponds to Windows Server 2022 (ltsc2022). + V21H2Server = 20348 + + // V21H2Win11 corresponds to Windows 11 (original release). + V21H2Win11 = 22000 ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go b/test/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go index 49fb740cd1..75dce5d821 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go +++ b/test/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go @@ -38,4 +38,13 @@ const ( // V21H1 corresponds to Windows Server 21H1 (semi-annual channel). V21H1 = 19043 + + // V21H2Win10 corresponds to Windows 10 (November 2021 Update). + V21H2Win10 = 19044 + + // V21H2Server corresponds to Windows Server 2022 (ltsc2022). + V21H2Server = 20348 + + // V21H2Win11 corresponds to Windows 11 (original release). + V21H2Win11 = 22000 ) From 7577f5bc06fc17f00aa30744a01ebfd09cf662dc Mon Sep 17 00:00:00 2001 From: Danny Canter <36526702+dcantah@users.noreply.github.com> Date: Wed, 1 Dec 2021 11:47:06 -0700 Subject: [PATCH 2/2] Add ws2022 image/build to cri-containerd tests (#1160) * Add ws2022 image/build to cri-integration tests This change adds a new case to the getWindowsServerCoreImage and getWindowsNanoserverImage functions to return ws2022 on a ws2022 or higher build. The higher case is because of some recent efforts to improve down-level compatability for Windows container images. For reference, the ltsc2022 image works on a win11 host without hypervisor isolation. Signed-off-by: Daniel Canter (cherry picked from commit f099e34878c260511ff37873b7231b5f2c769199) Signed-off-by: Daniel Canter --- test/cri-containerd/main.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/cri-containerd/main.go b/test/cri-containerd/main.go index ba67e7aa08..a2784a9d19 100644 --- a/test/cri-containerd/main.go +++ b/test/cri-containerd/main.go @@ -166,7 +166,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") } } @@ -183,7 +192,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") } }