Skip to content

Commit ce967dd

Browse files
authored
feat: use the official Pause image TAG instead of specifying the LTCS Windows version tag (#7675)
1 parent 9b82680 commit ce967dd

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

staging/cse/windows/containerd2template.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ state = 'C:\ProgramData\containerd\state'
2929
snapshotter = 'windows'
3030

3131
[plugins.'io.containerd.cri.v1.images'.pinned_images]
32-
sandbox = '{{pauseImage}}-windows-{{currentversion}}-amd64'
32+
sandbox = '{{pauseImage}}'
3333

3434
[plugins.'io.containerd.cri.v1.images'.registry]
3535
[plugins.'io.containerd.cri.v1.images'.registry.mirrors]
@@ -51,7 +51,7 @@ state = 'C:\ProgramData\containerd\state'
5151
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.default_runtime.options]
5252
Debug = false
5353
DebugType = 0
54-
SandboxImage = '{{pauseImage}}-windows-{{currentversion}}-amd64'
54+
SandboxImage = '{{pauseImage}}'
5555
SandboxPlatform = 'windows/amd64'
5656
SandboxIsolation = {{sandboxIsolation}}
5757

@@ -62,7 +62,7 @@ state = 'C:\ProgramData\containerd\state'
6262
[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runhcs-wcow-process.options]
6363
Debug = true
6464
DebugType = 2
65-
SandboxImage = '{{pauseImage}}-windows-{{currentversion}}-amd64'
65+
SandboxImage = '{{pauseImage}}'
6666
SandboxPlatform = 'windows/amd64'
6767
{{hypervisors}}
6868
[plugins.'io.containerd.cri.v1.runtime'.cni]
@@ -84,4 +84,4 @@ state = 'C:\ProgramData\containerd\state'
8484
enable_tls_streaming = false
8585

8686
[plugins.'io.containerd.service.v1.diff-service']
87-
default = ['windows']
87+
default = ['windows']

staging/cse/windows/containerdfunc.ps1

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function CreateHypervisorRuntimes {
104104
[Parameter(Mandatory = $true)][string]
105105
$image
106106
)
107-
107+
108108
Write-Log "Adding hyperv runtimes $builds"
109109
$hypervRuntimes = ""
110110
ForEach ($buildNumber in $builds) {
@@ -130,7 +130,7 @@ function ProcessAndWriteContainerdConfig {
130130
[Parameter(Mandatory = $true)][string]
131131
$CNIConfDir
132132
)
133-
133+
134134
$sandboxIsolation = 0
135135
if ($global:DefaultContainerdWindowsSandboxIsolation -eq "hyperv") {
136136
Write-Log "default runtime for containerd set to hyperv"
@@ -139,7 +139,7 @@ function ProcessAndWriteContainerdConfig {
139139

140140
$clusterConfig = ConvertFrom-Json ((Get-Content $global:KubeClusterConfigPath -ErrorAction Stop) | Out-String)
141141
$pauseImage = $clusterConfig.Cri.Images.Pause
142-
142+
143143
$hypervHandlers = $global:ContainerdWindowsRuntimeHandlers.split(",", [System.StringSplitOptions]::RemoveEmptyEntries)
144144
$hypervRuntimes = ""
145145

@@ -150,15 +150,15 @@ function ProcessAndWriteContainerdConfig {
150150

151151
$templatePath = [Io.Path]::Combine( $global:WindowsDataDir, $templateFilePath)
152152

153-
$template = Get-Content -Path $templatePath
153+
$template = Get-Content -Path $templatePath
154154
if ($SandboxIsolation -eq 0 -And $hypervHandlers.Count -eq 0) {
155155
# Remove the hypervisors placeholder when not needed
156156
$template = $template | Select-String -Pattern 'hypervisors' -NotMatch
157157
}
158158
else {
159159
$hypervRuntimes = CreateHypervisorRuntimes -builds $hypervHandlers -image $pauseImage
160160
}
161-
161+
162162
if (([version]$ContainerdVersion).CompareTo([version]"1.7.9") -lt 0) {
163163
# Remove annotations placeholders for older containerd versions
164164
$template = $template | Select-String -Pattern 'containerAnnotations' -NotMatch
@@ -171,18 +171,16 @@ function ProcessAndWriteContainerdConfig {
171171
$formatedconf = $(($CNIConfDir).Replace("\", "/"))
172172
$containerAnnotations = 'container_annotations = ["io.microsoft.container.processdumplocation", "io.microsoft.wcow.processdumptype", "io.microsoft.wcow.processdumpcount"]'
173173
$podAnnotations = 'pod_annotations = ["io.microsoft.container.processdumplocation","io.microsoft.wcow.processdumptype", "io.microsoft.wcow.processdumpcount"]'
174-
$pauseWindowsVersion = Get-WindowsPauseVersion
175174

176175
# Replace all placeholders
177176
$processedTemplate = $template.Replace('{{sandboxIsolation}}', $sandboxIsolation).
178177
Replace('{{pauseImage}}', $pauseImage).
179178
Replace('{{hypervisors}}', $hypervRuntimes).
180179
Replace('{{cnibin}}', $formatedBin).
181180
Replace('{{cniconf}}', $formatedConf).
182-
Replace('{{currentversion}}', $pauseWindowsVersion).
183181
Replace('{{containerAnnotations}}', $containerAnnotations).
184182
Replace('{{podAnnotations}}', $podAnnotations)
185-
183+
186184
# Write the processed template to the config file
187185
$configFile = [Io.Path]::Combine($global:ContainerdInstallLocation, "config.toml")
188186
Write-Log "using template $templatePath to write containerd config to $configFile"
@@ -223,7 +221,7 @@ function Install-Containerd {
223221
}
224222

225223
# Extract the package
226-
# upstream containerd package is a tar
224+
# upstream containerd package is a tar
227225
$tarfile = [Io.path]::Combine($ENV:TEMP, "containerd.tar.gz")
228226
DownloadFileOverHttp -Url $ContainerdUrl -DestinationPath $tarfile -ExitCode $global:WINDOWS_CSE_ERROR_DOWNLOAD_CONTAINERD_PACKAGE
229227
Create-Directory -FullPath $global:ContainerdInstallLocation -DirectoryUsage "storing containerd"
@@ -260,4 +258,4 @@ function Install-Containerd {
260258

261259
RegisterContainerDService -KubeDir $KubeDir
262260
Enable-Logging
263-
}
261+
}

staging/cse/windows/containerdtemplate.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ state = "C:\\ProgramData\\containerd\\state"
2525
stream_server_address = "127.0.0.1"
2626
stream_server_port = "0"
2727
enable_selinux = false
28-
sandbox_image = "{{pauseImage}}-windows-{{currentversion}}-amd64"
28+
sandbox_image = "{{pauseImage}}"
2929
stats_collect_period = 10
3030
systemd_cgroup = false
3131
enable_tls_streaming = false
@@ -42,7 +42,7 @@ state = "C:\\ProgramData\\containerd\\state"
4242
[plugins.cri.containerd.default_runtime.options]
4343
Debug = false
4444
DebugType = 0
45-
SandboxImage = "{{pauseImage}}-windows-{{currentversion}}-amd64"
45+
SandboxImage = "{{pauseImage}}"
4646
SandboxPlatform = "windows/amd64"
4747
SandboxIsolation = {{sandboxIsolation}}
4848
[plugins.cri.containerd.runtimes]
@@ -53,7 +53,7 @@ state = "C:\\ProgramData\\containerd\\state"
5353
[plugins.cri.containerd.runtimes.runhcs-wcow-process.options]
5454
Debug = true
5555
DebugType = 2
56-
SandboxImage = "{{pauseImage}}-windows-{{currentversion}}-amd64"
56+
SandboxImage = "{{pauseImage}}"
5757
SandboxPlatform = "windows/amd64"
5858
{{hypervisors}}
5959
[plugins.cri.cni]
@@ -70,4 +70,4 @@ state = "C:\\ProgramData\\containerd\\state"
7070
deletion_threshold = 0
7171
mutation_threshold = 100
7272
schedule_delay = "0s"
73-
startup_delay = "100ms"
73+
startup_delay = "100ms"

0 commit comments

Comments
 (0)