change shell var MINION_SCOPES to user setable

Because bash arrays may not be environment variables
 (see: <https://stackoverflow.com/questions/5564418/exporting-an-array-in-bash-script>)
 we have to change the MINION_SCOPES array to a string
* prefers aliases instead of full URLs for scopes

tested under GKE, needs GCE testing

Close #10458
This commit is contained in:
Chris Hiestand
2015-06-29 16:47:36 -07:00
parent bfd7477b5b
commit db1a73317c
8 changed files with 20 additions and 16 deletions

View File

@@ -685,11 +685,11 @@ function kube-up {
echo "Creating minions."
# TODO(mbforbes): Refactor setting scope flags.
local -a scope_flags=()
if (( "${#MINION_SCOPES[@]}" > 0 )); then
scope_flags=("--scopes" "$(join_csv ${MINION_SCOPES[@]})")
local scope_flags=
if [ -n "${MINION_SCOPES}" ]; then
scope_flags="--scopes ${MINION_SCOPES}"
else
scope_flags=("--no-scopes")
scope_flags="--no-scopes"
fi
write-node-env
@@ -1007,11 +1007,11 @@ function prepare-push() {
write-node-env
# TODO(mbforbes): Refactor setting scope flags.
local -a scope_flags=()
if (( "${#MINION_SCOPES[@]}" > 0 )); then
scope_flags=("--scopes" "${MINION_SCOPES[@]}")
local scope_flags=
if [ -n "${MINION_SCOPES}" ]; then
scope_flags="--scopes ${MINION_SCOPES}"
else
scope_flags=("--no-scopes")
scope_flags="--no-scopes"
fi
# Ugly hack: Since it is not possible to delete instance-template that is currently