Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

feat: Skip downloading of pause image if image already present in windows vhd #2040

Merged
merged 3 commits into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 14 additions & 2 deletions parts/k8s/windowskubeletfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down
16 changes: 14 additions & 2 deletions pkg/engine/templates_generated.go

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