mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-23 00:11:41 -04:00
Merge pull request #5192 from danisla/patch-1
Update to how zone is extracted from metadata
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user