diff --git a/synthtool/gcp/templates/node_library/.kokoro/populate-secrets.sh b/synthtool/gcp/templates/node_library/.kokoro/populate-secrets.sh index 6bfffa19f..30b4fa78c 100755 --- a/synthtool/gcp/templates/node_library/.kokoro/populate-secrets.sh +++ b/synthtool/gcp/templates/node_library/.kokoro/populate-secrets.sh @@ -22,9 +22,10 @@ function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} function msg { println "$*" >&2 ;} function println { printf '%s\n' "$(now) $*" ;} -if [[ -z "${SECRET_PROJECT}" ]] -then - SECRET_PROJECT=cloud-sdk-release-custom-pool +# Override to declare the GCP project that holds the secrets to fetch +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" fi # Populates requested secrets set in SECRET_MANAGER_KEYS @@ -69,7 +70,7 @@ do msg "Retrieving secret ${key}" "${GCLOUD_COMMANDS[@]}" \ secrets versions access latest \ - --project "${SECRET_PROJECT}" \ + --project "${SECRET_MANAGER_PROJECT_ID}" \ --secret $key > \ "$SECRET_LOCATION/$key" if [[ $? == 0 ]]; then diff --git a/synthtool/gcp/templates/node_library/.kokoro/release/common.cfg b/synthtool/gcp/templates/node_library/.kokoro/release/common.cfg index 802cad7b3..9a3c3fd01 100644 --- a/synthtool/gcp/templates/node_library/.kokoro/release/common.cfg +++ b/synthtool/gcp/templates/node_library/.kokoro/release/common.cfg @@ -1,4 +1,4 @@ env_vars: { - key: "SECRET_PROJECT" + key: "SECRET_MANAGER_PROJECT_ID" value: "cloud-sdk-release-custom-pool" } \ No newline at end of file