@@ -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+ }
0 commit comments