Skip to content

Commit

Permalink
feat: update pause image to 1.3.0 (includes 1903 and 1909 support) (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
marosset authored and AbelHu committed Mar 10, 2020
1 parent a83e596 commit 667afa8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 36 deletions.
30 changes: 12 additions & 18 deletions parts/k8s/windowskubeletfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -159,25 +159,19 @@ New-InfraContainer {
# Reference for these tags: curl -L https://mcr.microsoft.com/v2/k8s/core/pause/tags/list
# Then docker run --rm mplatform/manifest-tool inspect mcr.microsoft.com/k8s/core/pause:<tag>

$defaultPauseImage = "mcr.microsoft.com/k8s/core/pause:1.2.0"

switch ($computerInfo.WindowsVersion) {
"1803" {
$imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}"
if (-not $imageList) {
Invoke-Executable -Executable "docker" -ArgList @("pull", "$defaultPauseImage") -Retries 5 -RetryDelaySeconds 30
}
Invoke-Executable -Executable "docker" -ArgList @("tag", "$defaultPauseImage", "$DestinationTag")
}
"1809" {
$imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}"
if (-not $imageList) {
Invoke-Executable -Executable "docker" -ArgList @("pull", "$defaultPauseImage") -Retries 5 -RetryDelaySeconds 30
}
Invoke-Executable -Executable "docker" -ArgList @("tag", "$defaultPauseImage", "$DestinationTag")
$defaultPauseImage = "mcr.microsoft.com/oss/kubernetes/pause:1.3.0"

$pauseImageVersions = @("1803", "1809", "1903", "1909")

if ($pauseImageVersions -icontains $computerInfo.WindowsVersion) {
$imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}"
if (-not $imageList) {
Invoke-Executable -Executable "docker" -ArgList @("pull", "$defaultPauseImage") -Retries 5 -RetryDelaySeconds 30
}
"1903" { Build-PauseContainer -WindowsBase "mcr.microsoft.com/windows/nanoserver:1903" -DestinationTag $DestinationTag}
default { Build-PauseContainer -WindowsBase "mcr.microsoft.com/nanoserver-insider" -DestinationTag $DestinationTag}
Invoke-Executable -Executable "docker" -ArgList @("tag", "$defaultPauseImage", "$DestinationTag")
}
else {
Build-PauseContainer -WindowsBase "mcr.microsoft.com/nanoserver-insider" -DestinationTag $DestinationTag
}
}

Expand Down
28 changes: 11 additions & 17 deletions pkg/engine/templates_generated.go

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

2 changes: 1 addition & 1 deletion vhd/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Get-ContainerImages
$imagesToPull = @(
"mcr.microsoft.com/windows/servercore:ltsc2019",
"mcr.microsoft.com/windows/nanoserver:1809",
"mcr.microsoft.com/k8s/core/pause:1.2.0")
"mcr.microsoft.com/oss/kubernetes/pause:1.3.0")

foreach ($image in $imagesToPull) {
docker pull $image
Expand Down

0 comments on commit 667afa8

Please sign in to comment.