diff --git a/pipelines/shared-tasks/remove-orphaned-gke-clusters/task.sh b/pipelines/shared-tasks/remove-orphaned-gke-clusters/task.sh index 997f0062f..b763ced8e 100755 --- a/pipelines/shared-tasks/remove-orphaned-gke-clusters/task.sh +++ b/pipelines/shared-tasks/remove-orphaned-gke-clusters/task.sh @@ -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 diff --git a/pipelines/shared-tasks/remove-orphaned-kind-cluster-vms/task.sh b/pipelines/shared-tasks/remove-orphaned-kind-cluster-vms/task.sh index caf594bb9..387053c6f 100755 --- a/pipelines/shared-tasks/remove-orphaned-kind-cluster-vms/task.sh +++ b/pipelines/shared-tasks/remove-orphaned-kind-cluster-vms/task.sh @@ -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