Skip to content

Commit

Permalink
fix: do not override credentials if build providers a SECRET_MANAGER_…
Browse files Browse the repository at this point in the history
…PROJECT_ID (#11068)
  • Loading branch information
ldetmer authored Oct 31, 2024
1 parent 37191c6 commit 4fb2a0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function println { printf '%s\n' "$(now) $*"; }
if [[ -z "${SECRET_MANAGER_PROJECT_ID}" ]]; then
msg "SECRET_MANAGER_PROJECT_ID is not set in environment variables, using default"
SECRET_MANAGER_PROJECT_ID="cloud-devrel-kokoro-resources"
CREDENTIAL_FILE_OVERRIDE="${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json"
fi
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
Expand All @@ -33,7 +34,7 @@ for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g"); do
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
gcr.io/google.com/cloudsdktool/cloud-sdk \
secrets versions access latest \
--credential-file-override=${KOKORO_GFILE_DIR}/kokoro-trampoline.service-account.json \
--credential-file-override=${CREDENTIAL_FILE_OVERRIDE} \
--project ${SECRET_MANAGER_PROJECT_ID} \
--secret ${key} > \
"${SECRET_LOCATION}/${key}"
Expand Down

0 comments on commit 4fb2a0f

Please sign in to comment.