Merge pull request #5192 from danisla/patch-1

Update to how zone is extracted from metadata
This commit is contained in:
Matthew Hooker 2017-08-07 16:03:44 -07:00 committed by GitHub
commit 72deffc3d8
1 changed files with 1 additions and 1 deletions

View File

@ -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}