diff --git a/cluster/gce/list-resources.sh b/cluster/gce/list-resources.sh index 963b9b26a25..4ee86158a1d 100755 --- a/cluster/gce/list-resources.sh +++ b/cluster/gce/list-resources.sh @@ -47,7 +47,10 @@ function gcloud-compute-list() { local attempt=1 local result="" while true; do - if result=$(gcloud compute ${resource} list --project=${PROJECT} ${@:2} | grep "${GREP_REGEX}"); then + if result=$(gcloud compute ${resource} list --project=${PROJECT} ${@:2}); then + if [[ ! -z "${GREP_REGEX}" ]]; then + result=$(echo "${result}" | grep "${GREP_REGEX}") + fi echo "${result}" return fi