From 2784223407b58bdef964726a952f68809b951db2 Mon Sep 17 00:00:00 2001 From: Junjie Zhang <109257558+junjiezhang1997@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:17:59 +0800 Subject: [PATCH] chore: use latest image to deploy windows e2e vmss (#3550) --- e2e/windows/e2e-scenario.sh | 8 ++------ e2e/windows/windows_vmss_template.json | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/e2e/windows/e2e-scenario.sh b/e2e/windows/e2e-scenario.sh index a713a14a455..4c681f50f07 100644 --- a/e2e/windows/e2e-scenario.sh +++ b/e2e/windows/e2e-scenario.sh @@ -140,10 +140,7 @@ MC_WIN_VMSS_NAME=$(az vmss list -g $MC_RESOURCE_GROUP_NAME --query "[?contains(n VMSS_RESOURCE_Id=$(az resource show --resource-group $MC_RESOURCE_GROUP_NAME --name $MC_WIN_VMSS_NAME --resource-type Microsoft.Compute/virtualMachineScaleSets --query id --output tsv) az group export --resource-group $MC_RESOURCE_GROUP_NAME --resource-ids $VMSS_RESOURCE_Id --include-parameter-default-value > test.json -# TODO: use prod image -# IMAGE_REFERENCE=$(jq -c '.resources[0].properties.virtualMachineProfile.storageProfile.imageReference.id' test.json) -IMAGE_REFERENCE="[concat(parameters('galleries_AKSWindows_externalid'), '/images/windows-e2e-test-$WINDOWS_E2E_IMAGE/versions/2023.02.07')]" -IMAGE_EXTERNALID="/subscriptions/$IMAGE_SUBSCRIPTION_ID/resourceGroups/akswinvhdbuilderrg/providers/Microsoft.Compute/galleries/AKSWindows" +IMAGE_REFERENCE="/subscriptions/$IMAGE_SUBSCRIPTION_ID/resourceGroups/$IMAGE_RESOURCE_GROUP/providers/Microsoft.Compute/galleries/$IMAGE_GALLERY_NAME/images/windows-e2e-test-$WINDOWS_E2E_IMAGE/versions/latest" WINDOWS_VNET=$(jq -c '.parameters | with_entries( select(.key|contains("vnet")))' test.json) WINDOWS_LOADBALANCER=$(jq -c '.parameters | with_entries( select(.key|contains("loadBalancers")))' test.json) WINDOWS_IDENTITY=$(jq -c '.resources[0] | with_entries( select(.key|contains("identity")))' test.json) @@ -159,13 +156,12 @@ jq --argjson JsonForVnet "$WINDOWS_VNET" \ --argjson JsonForSKU "$WINDOWS_SKU" \ --argjson JsonForNetwork "$NETWORK_PROPERTIES" \ --argjson JsonForOSDisk "$WINDOWS_OSDISK" \ - --arg ValueForImageExternalID "$IMAGE_EXTERNALID" \ --arg ValueForImageReference "$IMAGE_REFERENCE" \ --arg ValueForAdminPassword "$WINDOWS_PASSWORD" \ --arg ValueForCustomData "$CUSTOM_DATA" \ --arg ValueForCSECmd "$CSE_CMD" \ --arg ValueForVMSS "$DEPLOYMENT_VMSS_NAME" \ - '.parameters += $JsonForVnet | .parameters += $JsonForLB | .parameters.galleries_AKSWindows_externalid.defaultValue=$ValueForImageExternalID | .resources[0] += $JsonForIdentity | .resources[0] += $JsonForSKU | .resources[0].properties.virtualMachineProfile.storageProfile+=$JsonForOSDisk | .resources[0].properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0] += $JsonForNetwork | .resources[0].properties.virtualMachineProfile.storageProfile.imageReference.id=$ValueForImageReference | .resources[0].properties.virtualMachineProfile.osProfile.adminPassword=$ValueForAdminPassword | .resources[0].properties.virtualMachineProfile.osProfile.customData=$ValueForCustomData | .resources[0].properties.virtualMachineProfile.extensionProfile.extensions[0].properties.settings.commandToExecute=$ValueForCSECmd | .parameters.virtualMachineScaleSets_akswin30_name.defaultValue=$ValueForVMSS' \ + '.parameters += $JsonForVnet | .parameters += $JsonForLB | .resources[0] += $JsonForIdentity | .resources[0] += $JsonForSKU | .resources[0].properties.virtualMachineProfile.storageProfile+=$JsonForOSDisk | .resources[0].properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0] += $JsonForNetwork | .resources[0].properties.virtualMachineProfile.storageProfile.imageReference.id=$ValueForImageReference | .resources[0].properties.virtualMachineProfile.osProfile.adminPassword=$ValueForAdminPassword | .resources[0].properties.virtualMachineProfile.osProfile.customData=$ValueForCustomData | .resources[0].properties.virtualMachineProfile.extensionProfile.extensions[0].properties.settings.commandToExecute=$ValueForCSECmd | .parameters.virtualMachineScaleSets_akswin30_name.defaultValue=$ValueForVMSS' \ windows_vmss_template.json > $DEPLOYMENT_VMSS_NAME-deployment.json retval=0 diff --git a/e2e/windows/windows_vmss_template.json b/e2e/windows/windows_vmss_template.json index ef30ca0531f..473268e918d 100644 --- a/e2e/windows/windows_vmss_template.json +++ b/e2e/windows/windows_vmss_template.json @@ -5,10 +5,6 @@ "virtualMachineScaleSets_akswin30_name": { "defaultValue": "", "type": "string" - }, - "galleries_AKSWindows_externalid": { - "defaultValue": "", - "type": "String" } }, "resources": [