Skip to content

Commit

Permalink
Update attempt-register-vm-on-proxy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
IronPan committed Mar 27, 2019
1 parent e60ee9a commit c962348
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/attempt-register-vm-on-proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ echo "Proxy URL from the config: ${PROXY_URL}"

# Register the proxy agent
VM_ID=$(curl -H 'Metadata-Flavor: Google' "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?format=full&audience=${PROXY_URL}/request-service-account-endpoint" 2>/dev/null)
RESULT_JSON=$(curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "X-Inverting-Proxy-VM-ID: ${VM_ID}" -d "" "${PROXY_URL}/request-endpoint" 2>/dev/null)
RESULT_JSON=$(curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "X-Inverting-Proxy-VM-ID: ${VM_ID}" -d "" "${PROXY_URL}/request-service-account-endpoint" 2>/dev/null)
echo "Response from the registration server: ${RESULT_JSON}"

HOSTNAME=$(echo "${RESULT_JSON}" | jq -r ".hostname")
Expand Down

0 comments on commit c962348

Please sign in to comment.