Pass arg lists to gcloud as comma-separated single arg

This should get rid of the scary warning messages on GCE up.

Fixes #8117
This commit is contained in:
Justin Santa Barbara 2015-05-23 00:07:09 -04:00
parent b7caedeedb
commit 521cb0e85b
5 changed files with 16 additions and 14 deletions

View File

@ -121,12 +121,11 @@ function create-master-instance {
--image "${MASTER_IMAGE}" \
--tags "${MASTER_TAG}" \
--network "${NETWORK}" \
--scopes "storage-ro" "compute-rw" \
--scopes "storage-ro,compute-rw" \
--can-ip-forward \
--metadata-from-file \
"startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh" \
"kube-env=${KUBE_TEMP}/master-kube-env.yaml" \
--disk name="${MASTER_NAME}-pd" device-name=master-pd mode=rw boot=no auto-delete=no
"startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh,kube-env=${KUBE_TEMP}/master-kube-env.yaml" \
--disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no"
}
# TODO(dawnchen): Check $CONTAINER_RUNTIME to decide which

View File

@ -99,12 +99,11 @@ function create-master-instance {
--image "${MASTER_IMAGE}" \
--tags "${MASTER_TAG}" \
--network "${NETWORK}" \
--scopes "storage-ro" "compute-rw" \
--scopes "storage-ro,compute-rw" \
--can-ip-forward \
--metadata-from-file \
"startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh" \
"kube-env=${KUBE_TEMP}/master-kube-env.yaml" \
--disk name="${MASTER_NAME}-pd" device-name=master-pd mode=rw boot=no auto-delete=no
"startup-script=${KUBE_ROOT}/cluster/gce/configure-vm.sh,kube-env=${KUBE_TEMP}/master-kube-env.yaml" \
--disk "name=${MASTER_NAME}-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no"
}
# TODO(mbforbes): Make $1 required.

View File

@ -159,7 +159,7 @@ function upgrade-nodes() {
# TODO(mbforbes): Refactor setting scope flags.
local -a scope_flags=()
if (( "${#MINION_SCOPES[@]}" > 0 )); then
scope_flags=("--scopes" "${MINION_SCOPES[@]}")
scope_flags=("--scopes" "$(join_csv ${MINION_SCOPES[@]})")
else
scope_flags=("--no-scopes")
fi

View File

@ -36,6 +36,10 @@ ALLOCATE_NODE_CIDRS=true
KUBE_PROMPT_FOR_UPDATE=y
KUBE_SKIP_UPDATE=${KUBE_SKIP_UPDATE-"n"}
function join_csv {
local IFS=','; echo "$*";
}
# Verify prereqs
function verify-prereqs {
local cmd
@ -363,7 +367,7 @@ function create-firewall-rule {
--network "${NETWORK}" \
--source-ranges "$2" \
--target-tags "$3" \
--allow tcp udp icmp esp ah sctp; then
--allow tcp,udp,icmp,esp,ah,sctp; then
if (( attempt > 5 )); then
echo -e "${color_red}Failed to create firewall rule $1 ${color_norm}"
exit 2
@ -459,7 +463,7 @@ function add-instance-metadata-from-file {
if ! gcloud compute instances add-metadata "${instance}" \
--project "${PROJECT}" \
--zone "${ZONE}" \
--metadata-from-file $(IFS=, ; echo "${kvs[*]}"); then
--metadata-from-file "$(join_csv ${kvs[@]})"; then
if (( attempt > 5 )); then
echo -e "${color_red}Failed to add instance metadata in ${instance} ${color_norm}"
exit 2
@ -575,7 +579,7 @@ function kube-up {
--project "${PROJECT}" \
--network "${NETWORK}" \
--source-ranges "10.0.0.0/8" \
--allow "tcp:1-65535" "udp:1-65535" "icmp" &
--allow "tcp:1-65535,udp:1-65535,icmp" &
fi
if ! gcloud compute firewall-rules describe --project "${PROJECT}" "${NETWORK}-default-ssh" &>/dev/null; then
@ -637,7 +641,7 @@ function kube-up {
# TODO(mbforbes): Refactor setting scope flags.
local -a scope_flags=()
if (( "${#MINION_SCOPES[@]}" > 0 )); then
scope_flags=("--scopes" "${MINION_SCOPES[@]}")
scope_flags=("--scopes" "$(join_csv ${MINION_SCOPES[@]})")
else
scope_flags=("--no-scopes")
fi

View File

@ -167,7 +167,7 @@ function test-setup() {
# collisions here?
"${GCLOUD}" compute firewall-rules create \
"${MINION_TAG}-${USER}-http-alt" \
--allow tcp:80 tcp:8080 \
--allow tcp:80,tcp:8080 \
--project "${PROJECT}" \
--target-tags "${MINION_TAG}" \
--network="${NETWORK}"