diff --git a/packer/configure-windows-vhd.ps1 b/packer/configure-windows-vhd.ps1 index edaad2a2e3..bb50d6866c 100644 --- a/packer/configure-windows-vhd.ps1 +++ b/packer/configure-windows-vhd.ps1 @@ -63,6 +63,7 @@ function Get-FilesToCacheOnVHD "https://acs-mirror.azureedge.net/wink8s/azs-v1.14.7-1int.zip", "https://acs-mirror.azureedge.net/wink8s/azs-v1.15.3-1int.zip", "https://acs-mirror.azureedge.net/wink8s/azs-v1.15.4-1int.zip", + "https://acs-mirror.azureedge.net/wink8s/azs-v1.16.0-1int.zip" "https://acs-mirror.azureedge.net/wink8s/v1.14.6-1int.zip", "https://acs-mirror.azureedge.net/wink8s/v1.14.7-1int.zip", "https://acs-mirror.azureedge.net/wink8s/v1.15.3-1int.zip", diff --git a/parts/k8s/windowskubeletfunc.ps1 b/parts/k8s/windowskubeletfunc.ps1 index 27783ae231..660f3fbbb0 100644 --- a/parts/k8s/windowskubeletfunc.ps1 +++ b/parts/k8s/windowskubeletfunc.ps1 @@ -162,8 +162,20 @@ New-InfraContainer { $defaultPauseImage = "mcr.microsoft.com/k8s/core/pause:1.2.0" switch ($computerInfo.WindowsVersion) { - "1803" { docker pull $defaultPauseImage ; docker tag $defaultPauseImage $DestinationTag } - "1809" { docker pull $defaultPauseImage ; docker tag $defaultPauseImage $DestinationTag } + "1803" { + $imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}" + if (-not $imageList) { + docker pull $defaultPauseImage + } + docker tag $defaultPauseImage $DestinationTag + } + "1809" { + $imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}" + if (-not $imageList) { + docker pull $defaultPauseImage + } + docker tag $defaultPauseImage $DestinationTag + } "1903" { Build-PauseContainer -WindowsBase "mcr.microsoft.com/windows/nanoserver:1903" -DestinationTag $DestinationTag} default { Build-PauseContainer -WindowsBase "mcr.microsoft.com/nanoserver-insider" -DestinationTag $DestinationTag} } diff --git a/pkg/engine/templates_generated.go b/pkg/engine/templates_generated.go index af4cd9052b..146100ad9b 100644 --- a/pkg/engine/templates_generated.go +++ b/pkg/engine/templates_generated.go @@ -26291,8 +26291,20 @@ New-InfraContainer { $defaultPauseImage = "mcr.microsoft.com/k8s/core/pause:1.2.0" switch ($computerInfo.WindowsVersion) { - "1803" { docker pull $defaultPauseImage ; docker tag $defaultPauseImage $DestinationTag } - "1809" { docker pull $defaultPauseImage ; docker tag $defaultPauseImage $DestinationTag } + "1803" { + $imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}" + if (-not $imageList) { + docker pull $defaultPauseImage + } + docker tag $defaultPauseImage $DestinationTag + } + "1809" { + $imageList = docker images $defaultPauseImage --format "{{.Repository}}:{{.Tag}}" + if (-not $imageList) { + docker pull $defaultPauseImage + } + docker tag $defaultPauseImage $DestinationTag + } "1903" { Build-PauseContainer -WindowsBase "mcr.microsoft.com/windows/nanoserver:1903" -DestinationTag $DestinationTag} default { Build-PauseContainer -WindowsBase "mcr.microsoft.com/nanoserver-insider" -DestinationTag $DestinationTag} }