From 2226b1de09daaa1a2ea3bbcff702f34dc2683e4f Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Fri, 2 Feb 2018 11:17:01 +0200 Subject: [PATCH] cluster/gce: fix shell return value comparison. In shell scripts inside [[ .. ]] blocks, ">" is a string comparison operator. The "attempt" number comparison works (most likely by accident) because the max number of attempts is below 10. Change to -gt operator. --- cluster/gce/list-resources.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/gce/list-resources.sh b/cluster/gce/list-resources.sh index a63be2c24f9..a95f9c50f76 100755 --- a/cluster/gce/list-resources.sh +++ b/cluster/gce/list-resources.sh @@ -57,7 +57,7 @@ function gcloud-compute-list() { fi echo -e "Attempt ${attempt} failed to list ${resource}. Retrying." >&2 attempt=$(($attempt+1)) - if [[ ${attempt} > 5 ]]; then + if [[ ${attempt} -gt 5 ]]; then echo -e "List ${resource} failed!" >&2 exit 2 fi