Skip to content

Commit

Permalink
Merge branch 'master' into andyzhangx/upgrade-csi-driver-image-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx authored Jan 24, 2024
2 parents 76882fd + 95d1a7a commit 59b0026
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vhdbuilder/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,19 @@ function Get-FilesToCacheOnVHD {
}
}

function Get-ToolsToVHD {
# Rely on the completion of Get-FilesToCacheOnVHD
$cacheDir = "c:\akse-cache\tools"

$toolsDir = "c:\aks-tools"
if (!(Test-Path -Path $toolsDir)) {
New-Item -ItemType Directory -Path $toolsDir | Out-Null
}

Write-Log "Getting DU (Windows Disk Usage)"
Expand-Archive -Path "$cacheDir\DU.zip" -DestinationPath "$toolsDir\DU" -Force
}

function Get-PrivatePackagesToCacheOnVHD {
if (![string]::IsNullOrEmpty($env:WindowsPrivatePackagesURL)) {
Write-Log "Caching private packages on VHD"
Expand Down Expand Up @@ -813,6 +826,7 @@ try{
Update-Registry
Get-ContainerImages
Get-FilesToCacheOnVHD
Get-ToolsToVHD # Rely on the completion of Get-FilesToCacheOnVHD
Get-PrivatePackagesToCacheOnVHD
Remove-Item -Path c:\windows-vhd-configuration.ps1
(New-Guid).Guid | Out-File -FilePath 'c:\vhd-id.txt'
Expand Down
3 changes: 3 additions & 0 deletions vhdbuilder/packer/generate-windows-vhd-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ $global:map = @{
"c:\akse-cache\calico\" = @(
"https://acs-mirror.azureedge.net/calico-node/v3.21.6/binaries/calico-windows-v3.21.6.zip",
"https://acs-mirror.azureedge.net/calico-node/v3.24.0/binaries/calico-windows-v3.24.0.zip"
);
"c:\akse-cache\tools\" = @(
"https://download.sysinternals.com/files/DU.zip"
)
}
'@
Expand Down
14 changes: 14 additions & 0 deletions vhdbuilder/packer/test/windows-vhd-content-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,19 @@ function Test-WindowsDefenderPlatformUpdate {
}
}

function Test-ToolsToCacheOnVHD {
$toolsDir = "c:\aks-tools"
$toolsList = @("DU\du.exe", "DU\du64.exe", "DU\du64a.exe")

foreach ($tool in $toolsList) {
$toolPath = Join-Path -Path $toolsDir -ChildPath $tool
if (!(Test-Path -Path $toolPath)) {
Write-ErrorWithTimestamp "Failed to get tool: $toolPath"
exit 1
}
}
}

Test-FilesToCacheOnVHD
Test-PatchInstalled
Test-ImagesPulled
Expand All @@ -514,4 +527,5 @@ Test-DefenderSignature
Test-AzureExtensions
Test-ExcludeUDPSourcePort
Test-WindowsDefenderPlatformUpdate
Test-ToolsToCacheOnVHD
Remove-Item -Path c:\windows-vhd-configuration.ps1

0 comments on commit 59b0026

Please sign in to comment.