fix: Removed dependency on 'ReleaseId' for WS2022 (#4659)

* fix: Removed dependency on 'ReleaseId' for WS2022
This commit is contained in:
Nicolas Belovoskey 2022-03-15 16:08:26 -07:00 коммит произвёл GitHub
Родитель 6e804b550a
Коммит fa4eebf72a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 22 добавлений и 16 удалений

Просмотреть файл

@ -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
@ -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)

Просмотреть файл

@ -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") {

Просмотреть файл

@ -23620,10 +23620,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
@ -23681,13 +23689,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)
@ -24100,7 +24103,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") {