From ccecb115edb56aeb4582c3c7db5886d6727180fd Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Fri, 8 May 2015 15:53:09 -0700 Subject: [PATCH] Don't print debugging things on every run of kubectl.sh --- cluster/gce/util.sh | 5 ++--- cluster/kubectl.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index bcc4c22cb7e..508abe49738 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -23,11 +23,10 @@ source "${KUBE_ROOT}/cluster/gce/${KUBE_CONFIG_FILE-"config-default.sh"}" source "${KUBE_ROOT}/cluster/common.sh" if [[ "${OS_DISTRIBUTION}" == "debian" || "${OS_DISTRIBUTION}" == "coreos" ]]; then - echo "Starting cluster using os distro: ${OS_DISTRIBUTION}" >&2 source "${KUBE_ROOT}/cluster/gce/${OS_DISTRIBUTION}/helper.sh" else - echo "Cannot start cluster using os distro: ${OS_DISTRIBUTION}" >&2 - return + echo "Cannot operate on cluster using os distro: ${OS_DISTRIBUTION}" >&2 + exit 1 fi NODE_INSTANCE_PREFIX="${INSTANCE_PREFIX}-minion" diff --git a/cluster/kubectl.sh b/cluster/kubectl.sh index 35e4bbc30cb..358f1ec257c 100755 --- a/cluster/kubectl.sh +++ b/cluster/kubectl.sh @@ -114,7 +114,11 @@ elif [[ "$KUBERNETES_PROVIDER" == "ubuntu" ]]; then ) fi -echo "current-context: \"$(${kubectl} "${config[@]:+${config[@]}}" config view -o template --template='{{index . "current-context"}}')\"" >&2 -echo "Running:" "${kubectl}" "${config[@]:+${config[@]}}" "${@+$@}" >&2 +if false; then + # disable these debugging messages by default + echo "current-context: \"$(${kubectl} "${config[@]:+${config[@]}}" config view -o template --template='{{index . "current-context"}}')\"" >&2 + echo "Running:" "${kubectl}" "${config[@]:+${config[@]}}" "${@+$@}" >&2 +fi + "${kubectl}" "${config[@]:+${config[@]}}" "${@+$@}"