From 972acb7e289b6240ca8f90dc831a805010570864 Mon Sep 17 00:00:00 2001 From: marosset Date: Wed, 24 Mar 2021 11:35:25 -0700 Subject: [PATCH] fix: specify correct pause image in containerd config for Windows 20h2 --- parts/k8s/windowscontainerdfunc.ps1 | 8 +++++++- pkg/engine/templates_generated.go | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/parts/k8s/windowscontainerdfunc.ps1 b/parts/k8s/windowscontainerdfunc.ps1 index 5db775d5e1f..aa684ba23ba 100644 --- a/parts/k8s/windowscontainerdfunc.ps1 +++ b/parts/k8s/windowscontainerdfunc.ps1 @@ -80,6 +80,7 @@ function Select-Windows-Version { "18362" { return "1903" } "18363" { return "1909" } "19041" { return "2004" } + "19042" { return "20H2" } Default { return "" } } } @@ -143,7 +144,12 @@ function Install-Containerd { $formatedbin = $(($CNIBinDir).Replace("\", "/")) $formatedconf = $(($CNIConfDir).Replace("\", "/")) $sandboxIsolation = 0 - $windowsVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId + $windowsReleaseId = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId + switch ($windowsReleaseId) + { + "2009" { $windowsVersion = "20H2"} + default { $windowsVersion = $windowsReleaseId} + } $hypervRuntimes = "" $hypervHandlers = $global:HypervRuntimeHandlers.split(",", [System.StringSplitOptions]::RemoveEmptyEntries) diff --git a/pkg/engine/templates_generated.go b/pkg/engine/templates_generated.go index e26449a665a..6d0a3aaa163 100644 --- a/pkg/engine/templates_generated.go +++ b/pkg/engine/templates_generated.go @@ -18934,6 +18934,7 @@ function Select-Windows-Version { "18362" { return "1903" } "18363" { return "1909" } "19041" { return "2004" } + "19042" { return "20H2" } Default { return "" } } } @@ -18997,7 +18998,12 @@ function Install-Containerd { $formatedbin = $(($CNIBinDir).Replace("\", "/")) $formatedconf = $(($CNIConfDir).Replace("\", "/")) $sandboxIsolation = 0 - $windowsVersion = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId + $windowsReleaseId = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId + switch ($windowsReleaseId) + { + "2009" { $windowsVersion = "20H2"} + default { $windowsVersion = $windowsReleaseId} + } $hypervRuntimes = "" $hypervHandlers = $global:HypervRuntimeHandlers.split(",", [System.StringSplitOptions]::RemoveEmptyEntries)