Skip to content

Commit

Permalink
feat: hub make decode work with -d or --decode (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-pharaoh committed Sep 15, 2020
1 parent 6f419c3 commit 0b5bd3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/hub/scripts/gke_hub_registration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PROJECT_ID=$5
tmp_file=$(mktemp)
# shellcheck disable=SC2064
trap "rm -rf $tmp_file" EXIT
echo "${SERVICE_ACCOUNT_KEY}" | base64 --decode > "$tmp_file"
base64 --help | grep "\--decode" && B64_ARG="--decode" || B64_ARG="-d"
echo "${SERVICE_ACCOUNT_KEY}" | base64 ${B64_ARG} > "$tmp_file"

gcloud container hub memberships register "${MEMBERSHIP_NAME}" --gke-cluster="${CLUSTER_LOCATION}"/"${CLUSTER_NAME}" --service-account-key-file="${tmp_file}" --project="${PROJECT_ID}" --quiet

0 comments on commit 0b5bd3d

Please sign in to comment.