Fix issue where gsutil / gcloud cannot be found on Ubuntu 18.04 due to a race with the snap mount
@@ -19,6 +19,11 @@ set -euxo pipefail
# Ubuntu 18.04 installs gcloud, gsutil, etc. commands in /snap/bin
PATH=$PATH:/snap/bin
+until command -v gsutil &>/dev/null; do
+ echo "Waiting for gsutil / gcloud to become available..."
+ sleep 1
+done
+
# If available: Use a persistent disk as a use-case specific data volume.
if [[ -e /dev/sdb ]]; then
if [[ ! -e /dev/vg0 ]]; then
