mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-08 07:11:53 +00:00
fix typo and add guard statement in job to remove orphaned AKS clusters
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user