File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 5151 ./import_resources.sh
5252
5353 - name : Terraform Apply
54+ timeout-minutes : 120 # Increase timeout to 2 hours for AKS node pool operations
5455 run : |
5556 cd infra/azure
57+ # Set TF_PLUGIN_TIMEOUT to increase the timeout for Azure provider operations
58+ export TF_PLUGIN_TIMEOUT=120m
5659 terraform apply -auto-approve \
5760 -var="environment=${{ env.ENVIRONMENT }}" \
5861 -var="memgraph_username=${{ secrets.MEMGRAPH_USERNAME }}" \
Original file line number Diff line number Diff line change @@ -161,6 +161,15 @@ resource "null_resource" "cleanup_unmanaged_resources" {
161161set -e
162162echo "Starting cleanup of unmanaged resources in ${ data . azurerm_resource_group . github . name } resource group..."
163163
164+ # Check if there are any ongoing operations on the AKS cluster
165+ AKS_NAME="aks-ai-agent-${ var . environment } "
166+ AKS_PROVISIONING_STATE=$(az aks show --name $AKS_NAME --resource-group ${ data . azurerm_resource_group . github . name } --query "provisioningState" -o tsv 2>/dev/null || echo "NotFound")
167+
168+ if [[ "$AKS_PROVISIONING_STATE" != "Succeeded" && "$AKS_PROVISIONING_STATE" != "NotFound" ]]; then
169+ echo "AKS cluster is currently in $AKS_PROVISIONING_STATE state. Skipping cleanup to avoid conflicts."
170+ exit 0
171+ fi
172+
164173# Get all resources in the resource group
165174ALL_RESOURCES=$(az resource list --resource-group ${ data . azurerm_resource_group . github . name } --query "[].id" -o tsv)
166175
You can’t perform that action at this time.
0 commit comments