From 00797cc23b5b3ea81c8cac42bf1eced41ac3fefa Mon Sep 17 00:00:00 2001 From: Dan Isla Date: Sat, 29 Jul 2017 08:20:58 -0700 Subject: [PATCH] Update to how zone is extracted from metadata --- builder/googlecompute/startup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/googlecompute/startup.go b/builder/googlecompute/startup.go index a94c91141..687afec98 100644 --- a/builder/googlecompute/startup.go +++ b/builder/googlecompute/startup.go @@ -21,7 +21,7 @@ GetMetadata () { echo "$(curl -f -H "Metadata-Flavor: Google" ${BASEMETADATAURL}/${1} 2> /dev/null)" } -ZONE=$(GetMetadata zone | grep -oP "[^/]*$") +ZONE=$(basename $(GetMetadata zone)) SetMetadata () { gcloud compute instances add-metadata ${HOSTNAME} --metadata ${1}=${2} --zone ${ZONE}