updated gcp_service_account_credential_to_secret.sh

pull/2/head
Hari Sekhon 3 years ago
parent e7f716aea4
commit 793177e5e5

@ -47,11 +47,10 @@ name="$1"
# will reconstruct the full id / service account email using the project and naming convention
name="${name%%@*}"
project="${2:-$(gcloud config list --format='get(core.project)')}"
# XXX: fix the GCP project for the duration of the script for consistency
not_blank "$project" || die "ERROR: no project specified and GCloud SDK core.project value not set"
export CLOUDSDK_CORE_PROJECT="$project"
# XXX: sets the GCP project for the duration of the script for consistency purposes (relying on gcloud config could lead to race conditions)
project="$(gcloud config list --format='get(core.project)' || :)"
export CLOUDSDK_CORE_PROJECT="${CLOUDSDK_CORE_PROJECT:-$project}"
not_blank "$CLOUDSDK_CORE_PROJECT" || die "ERROR: \$CLOUDSDK_CORE_PROJECT / GCloud SDK config core.project value not set"
description="${3:-}"

Loading…
Cancel
Save