Merge pull request #5192 from danisla/patch-1
Update to how zone is extracted from metadata
This commit is contained in:
commit
72deffc3d8
|
@ -21,7 +21,7 @@ GetMetadata () {
|
||||||
echo "$(curl -f -H "Metadata-Flavor: Google" ${BASEMETADATAURL}/${1} 2> /dev/null)"
|
echo "$(curl -f -H "Metadata-Flavor: Google" ${BASEMETADATAURL}/${1} 2> /dev/null)"
|
||||||
}
|
}
|
||||||
|
|
||||||
ZONE=$(GetMetadata zone | grep -oP "[^/]*$")
|
ZONE=$(basename $(GetMetadata zone))
|
||||||
|
|
||||||
SetMetadata () {
|
SetMetadata () {
|
||||||
gcloud compute instances add-metadata ${HOSTNAME} --metadata ${1}=${2} --zone ${ZONE}
|
gcloud compute instances add-metadata ${HOSTNAME} --metadata ${1}=${2} --zone ${ZONE}
|
||||||
|
|
Loading…
Reference in New Issue