From 9e015fd216bee98129b800f0df79c997ed92edf6 Mon Sep 17 00:00:00 2001 From: Eric Tune Date: Thu, 12 Feb 2015 11:39:53 -0800 Subject: [PATCH] Handle unset dollar-at. 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. --- cluster/kubectl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/kubectl.sh b/cluster/kubectl.sh index 9a4ca11fdea..9cf53d0e5fa 100755 --- a/cluster/kubectl.sh +++ b/cluster/kubectl.sh @@ -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[@]}}" "${@+$@}"