Skip to content

Commit

Permalink
feat: use one ignore list for windows vhd test (#4504)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelHu authored Jun 12, 2024
1 parent 7de70cc commit 45bbac8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
11 changes: 11 additions & 0 deletions vhdbuilder/packer/generate-windows-vhd-configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ $global:aksToolsDir = "c:\aks-tools"
# We need to guarantee that the node provisioning will not fail because the vhd is full before resize-osdisk is called in AKS Windows CSE script.
$global:lowestFreeSpace = 2*1024*1024*1024 # 2GB
$global:excludeHashComparisionListInAzureChinaCloud = @(
"calico-windows",
"azure-vnet-cni-singletenancy-windows-amd64",
"azure-vnet-cni-singletenancy-swift-windows-amd64",
"azure-vnet-cni-singletenancy-overlay-windows-amd64",
# We need upstream's help to republish this package. Before that, it does not impact functionality and 1.26 is only in public preview
# so we can ignore the different hash values.
"v1.26.0-1int.zip",
"azure-acr-credential-provider-windows-amd64-v1.29.2.tar.gz"
)
# defaultContainerdPackageUrl refers to the stable containerd package used to pull and cache container images
# Add cache for another containerd version which is not installed by default
$global:defaultContainerdPackageUrl = "https://acs-mirror.azureedge.net/containerd/windows/v1.6.21-azure.1/binaries/containerd-v1.6.21-azure.1-windows-amd64.tar.gz"
Expand Down
13 changes: 1 addition & 12 deletions vhdbuilder/packer/test/windows-files-check.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,6 @@ function Test-CompareSingleDir {
New-Item -ItemType Directory $dir -Force | Out-Null
}

$excludeHashComparisionListInAzureChinaCloud = @(
"calico-windows",
"azure-vnet-cni-singletenancy-windows-amd64",
"azure-vnet-cni-singletenancy-swift-windows-amd64",
"azure-vnet-cni-singletenancy-overlay-windows-amd64",
# We need upstream's help to republish this package. Before that, it does not impact functionality and 1.26 is only in public preview
# so we can ignore the different hash values.
"v1.26.0-1int.zip",
"azure-acr-credential-provider-windows-amd64-v1.29.2.tar.gz"
)

foreach ($URL in $map[$dir]) {
$fileName = [IO.Path]::GetFileName($URL)
$dest = [IO.Path]::Combine($dir, $fileName)
Expand All @@ -197,7 +186,7 @@ function Test-CompareSingleDir {
$globalFileSize = (Get-Item $dest).length

$isIgnore=$False
foreach($excludePackage in $excludeHashComparisionListInAzureChinaCloud) {
foreach($excludePackage in $global:excludeHashComparisionListInAzureChinaCloud) {
if ($URL.Contains($excludePackage)) {
$isIgnore=$true
break
Expand Down
14 changes: 1 addition & 13 deletions vhdbuilder/packer/test/windows-vhd-content-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,8 @@ function Test-FilesToCacheOnVHD
$localFileSize = (Get-Item $dest).length
$remoteFileSize = (Invoke-WebRequest $mcURL -UseBasicParsing -Method Head).Headers.'Content-Length'
if ($localFileSize -ne $remoteFileSize) {
# Please also update excludeHashComparisionListInAzureChinaCloud in vhdbuilder/packer/test/windows-files-check.ps1
$excludeHashComparisionListInAzureChinaCloud = @(
"calico-windows",
"azure-vnet-cni-singletenancy-windows-amd64",
"azure-vnet-cni-singletenancy-swift-windows-amd64",
"azure-vnet-cni-singletenancy-overlay-windows-amd64",
# We need upstream's help to republish this package. Before that, it does not impact functionality and 1.26 is only in public preview
# so we can ignore the different hash values.
"v1.26.0-1int.zip",
"azure-acr-credential-provider-windows-amd64-v1.29.2.tar.gz"
)

$isIgnore=$False
foreach($excludePackage in $excludeHashComparisionListInAzureChinaCloud) {
foreach($excludePackage in $global:excludeHashComparisionListInAzureChinaCloud) {
if ($mcURL.Contains($excludePackage)) {
$isIgnore=$true
break
Expand Down

0 comments on commit 45bbac8

Please sign in to comment.