Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 10 additions & 7 deletions parts/k8s/windowscontainerdfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,18 @@ function Select-Windows-Version {
"18363" { return "1909" }
"19041" { return "2004" }
"19042" { return "20H2" }
"20348" { return "ltsc2022" }
Default { return "" }
}
}

function Get-WindowsVersion {
$windowsCurrentBuild = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").CurrentBuild
$windowsVersion = Select-Windows-Version -buildNumber $windowsCurrentBuild

return $windowsVersion
}

function Enable-Logging {
if ((Test-Path "$global:ContainerdInstallLocation\diag.ps1") -And (Test-Path "$global:ContainerdInstallLocation\ContainerPlatform.wprp")) {
$logs = Join-path $pwd.drive.Root logs
Expand Down Expand Up @@ -160,13 +168,8 @@ function Install-Containerd {
$formatedbin = $(($CNIBinDir).Replace("\", "/"))
$formatedconf = $(($CNIConfDir).Replace("\", "/"))
$sandboxIsolation = 0
$windowsReleaseId = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId
# Starting with 20H2 tags used to publish contianer images may not match the 'ReleaseId'
switch ($windowsReleaseId)
{
"2009" { $windowsVersion = "20H2"}
default { $windowsVersion = $windowsReleaseId}
}
$windowsVersion = Get-WindowsVersion

$hypervRuntimes = ""
$hypervHandlers = $global:HypervRuntimeHandlers.split(",", [System.StringSplitOptions]::RemoveEmptyEntries)

Expand Down
2 changes: 1 addition & 1 deletion parts/k8s/windowskubeletfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ New-InfraContainer {
$clusterConfig = ConvertFrom-Json ((Get-Content $global:KubeClusterConfigPath -ErrorAction Stop) | Out-String)
$defaultPauseImage = $clusterConfig.Cri.Images.Pause

$pauseImageVersions = @("1809", "1903", "1909", "2004", "2009", "20h2")
$pauseImageVersions = @("1809", "1903", "1909", "2004", "2009", "20h2", "ltsc2022")

if ($pauseImageVersions -icontains $windowsVersion) {
if ($ContainerRuntime -eq "docker") {
Expand Down
19 changes: 11 additions & 8 deletions pkg/engine/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.