diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index 6b1d5962f..13f34fb1e 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -967,7 +967,8 @@ jobs: for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do state=$(az k8s-extension show --name azuremonitor-metrics --cluster-name ci-dev-arc-wcus --resource-group ci-dev-arc-wcus --cluster-type connectedClusters | jq -r '.provisioningState') - if [ $state = "Succeeded" ] + # We want to wait in case the status is 'Creating' or 'Updating' because of another PR merged shortly before the current one. + if [ "$state" = "Succeeded" ] || [ "$state" = "Failed" ] then echo "Cluster is ready to install extension" exit 0