diff options
author | Franck Cuny <franck@fcuny.net> | 2022-08-15 17:50:24 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-08-15 17:51:44 -0700 |
commit | 5f4622615994af1c8bd7f5cf8c1b5dcc0956578d (patch) | |
tree | ae52fd2ab0040b2987a8838af5df369f9e7b6ba4 /ops | |
parent | feat(ops/gcp-backups): add terraform configuration for GCP buckets (diff) | |
download | world-5f4622615994af1c8bd7f5cf8c1b5dcc0956578d.tar.gz |
fix(shellcheck): apply recommendations from shellcheck
Change-Id: Id11ad998c30d6e863ab3b43552b9fe248a0d6c7f Reviewed-on: https://cl.fcuny.net/c/world/+/716 Tested-by: CI Reviewed-by: Franck Cuny <franck@fcuny.net>
Diffstat (limited to 'ops')
-rwxr-xr-x | ops/tf-gcs-init/tf-gcs-init.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ops/tf-gcs-init/tf-gcs-init.sh b/ops/tf-gcs-init/tf-gcs-init.sh index 3a8f2b3..95d4d7e 100755 --- a/ops/tf-gcs-init/tf-gcs-init.sh +++ b/ops/tf-gcs-init/tf-gcs-init.sh @@ -26,7 +26,7 @@ GCP_SERVICE_ACCOUNT_ROLES=( ) function bucket:exist() { - if gsutil ls gs://${1} &>/dev/null; then + if gsutil ls gs://"${1}" &>/dev/null; then true else false @@ -67,11 +67,11 @@ function service_account() { } function service_account:has_role() { - [[ $(gcloud projects get-iam-policy ${1} --flatten=bindings --filter="bindings.members=serviceAccount:${2} AND bindings.role=$3" 2>/dev/null | wc -l) -ne 0 ]] + [[ $(gcloud projects get-iam-policy "${1}" --flatten=bindings --filter="bindings.members=serviceAccount:${2} AND bindings.role=$3" 2>/dev/null | wc -l) -ne 0 ]] } function service_account:admins_token_creator() { - [[ $(gcloud --project=${1} iam service-accounts get-iam-policy ${GCP_SERVICE_ACCOUNT} --flatten=bindings --filter="bindings.members=user:${GCP_ADMIN_ACCOUNT} AND bindings.role=roles/iam.serviceAccountTokenCreator" 2>/dev/null | wc -l) -ne 0 ]] + [[ $(gcloud --project="${1}" iam service-accounts get-iam-policy ${GCP_SERVICE_ACCOUNT} --flatten=bindings --filter="bindings.members=user:${GCP_ADMIN_ACCOUNT} AND bindings.role=roles/iam.serviceAccountTokenCreator" 2>/dev/null | wc -l) -ne 0 ]] } function roles() { |