Skip to content

Commit

Permalink
Handle unset dollar-at.
Browse files Browse the repository at this point in the history
When no args are passed to a script, "$@" is unset,
which causes a shell error in "nounset" mode.

This change passes an empty string to kubectl in that case
so it can print help.
  • Loading branch information
erictune committed Feb 12, 2015
1 parent 42f0458 commit 9e015fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster/kubectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,5 @@ if [[ -n "${KUBE_MASTER_IP-}" && -z "${KUBERNETES_MASTER-}" ]]; then
export KUBERNETES_MASTER=https://${KUBE_MASTER_IP}
fi

echo "Running:" "${kubectl}" "${config[@]:+${config[@]}}" "${@}" >&2
"${kubectl}" "${config[@]:+${config[@]}}" "${@}"
echo "Running:" "${kubectl}" "${config[@]:+${config[@]}}" "${@+$@}" >&2
"${kubectl}" "${config[@]:+${config[@]}}" "${@+$@}"

0 comments on commit 9e015fd

Please sign in to comment.