fix(CI): bytt metadata-token til gcloud auth print-identity-token i smoke-test
This commit is contained in:
parent
3358f1ee22
commit
4e12144152
|
|
@ -58,7 +58,7 @@ steps:
|
|||
- '--quiet'
|
||||
|
||||
# Steg 5: Smoke test — verifiser at agenten svarer etter deploy
|
||||
# CI6-lærdom: identity token med riktig audience, ikke access token
|
||||
# Bruker gcloud auth print-identity-token (fungerer i Cloud Build 2nd gen)
|
||||
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
|
||||
id: smoke-test
|
||||
waitFor: ['deploy']
|
||||
|
|
@ -67,12 +67,11 @@ steps:
|
|||
- '-c'
|
||||
- |
|
||||
echo "=== Smoke Test ==="
|
||||
TOKEN=$(curl -sf \
|
||||
-H "Metadata-Flavor: Google" \
|
||||
"http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience=https://${_CLOUD_RUN_URL}&format=full") \
|
||||
TOKEN=$$(gcloud auth print-identity-token \
|
||||
--audiences="https://${_CLOUD_RUN_URL}") \
|
||||
|| { echo "❌ Kunne ikke hente identity token"; exit 1; }
|
||||
|
||||
RESPONSE=$(curl -sf \
|
||||
RESPONSE=$$(curl -sf \
|
||||
-H "Authorization: Bearer $$TOKEN" \
|
||||
-H "x-goog-authenticated-user-email: accounts.google.com:ci-test@vauco.no" \
|
||||
-H "Content-Type: application/json" \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user