Skip to content

Commit

Permalink
chore: use latest image to deploy windows e2e vmss (#3550)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjiezhang1997 authored Aug 22, 2023
1 parent cb86e40 commit 2784223
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 2 additions & 6 deletions e2e/windows/e2e-scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions e2e/windows/windows_vmss_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"virtualMachineScaleSets_akswin30_name": {
"defaultValue": "",
"type": "string"
},
"galleries_AKSWindows_externalid": {
"defaultValue": "",
"type": "String"
}
},
"resources": [
Expand Down

0 comments on commit 2784223

Please sign in to comment.