use new --filter syntax in scripts to remove orphaned Kind/GKE clusters

The old filter syntax is deprecated by Google.
This commit is contained in:
Ryan Richard
2024-12-23 11:17:04 -08:00
parent 793559c67c
commit 171ec457f1
2 changed files with 2 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ gcloud auth activate-service-account \
all_cloud=($(gcloud container clusters list \
--zone "$CLUSTER_ZONE" --project "$GCP_PROJECT" \
--filter "name:gke-*-zone-${CLUSTER_ZONE}" --format 'table[no-heading](name)' | sort))
--filter "name~gke-[a-f0-9]+-zone-${CLUSTER_ZONE}" --format 'table[no-heading](name)' | sort))
now_in_seconds_since_epoch=$(date +"%s")
hours_ago_to_delete=2

View File

@@ -38,7 +38,7 @@ fi
all_cloud=($(gcloud compute instances list \
--zones "$INSTANCE_ZONE" --project "$GCP_PROJECT" \
--filter 'name:kind-worker-*' --format 'table[no-heading](name)' | sort))
--filter 'name~kind-worker-[a-f0-9]+' --format 'table[no-heading](name)' | sort))
exists_in_local_but_not_cloud=()
for i in "${all_local[@]}"; do