fix typo and add guard statement in job to remove orphaned AKS clusters

This commit is contained in:
Ryan Richard
2025-01-03 14:34:11 -08:00
parent cbe99119a2
commit 26ccd824a4
2 changed files with 6 additions and 1 deletions

View File

@@ -174,6 +174,6 @@ jobs:
attempts: 2
timeout: 25m
file: pinniped-ci/pipelines/shared-tasks/remove-orphaned-aks-clusters/task.yml
image: gcloud-image
image: aks-deployer-image
params:
<<: *azure_account_params

View File

@@ -29,6 +29,11 @@ az rest \
--url "https://management.azure.com/subscriptions/${AZURE_SUBSCRIPTION_ID}/resources" \
--url-parameters api-version=2024-08-01 \$expand=createdTime >all-resources.json
if [[ $(jq '.value | length' all-resources.json) == "0" ]]; then
echo "No resources were found in the subscription. Does the service account have permissions to list all resources?"
exit 1
fi
# Filter resources by clusters in the expected resource group.
# Write another file where each line is a cluster name, followed by a space, followed by its creation time.
cat all-resources.json |