From 4e1ab8045bb42fc679467d727447aa28b9fd0786 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Wed, 12 Nov 2014 13:30:53 -0800 Subject: [PATCH] fix e2e.go args for kubectl --- hack/e2e.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hack/e2e.go b/hack/e2e.go index 0736cefffcb..0f7dcd5f304 100644 --- a/hack/e2e.go +++ b/hack/e2e.go @@ -216,13 +216,22 @@ func finishRunning(stepName string, cmd *exec.Cmd) bool { // returns either "", or a list of args intended for appending with the // kubecfg or kubectl commands (begining with a space). -func kubeClientArgs() string { +func kubecfgArgs() string { if *checkVersionSkew { return " -expect_version_match" } return "" } +// returns either "", or a list of args intended for appending with the +// kubectl command (begining with a space). +func kubectlArgs() string { + if *checkVersionSkew { + return " --match-server-version" + } + return "" +} + func bashWrap(cmd string) string { return ` set -o errexit @@ -233,8 +242,8 @@ export KUBE_CONFIG_FILE="config-test.sh" # TODO(jbeda): This will break on usage if there is a space in # ${KUBE_ROOT}. Covert to an array? Or an exported function? -export KUBECFG="` + *root + `/cluster/kubecfg.sh` + kubeClientArgs() + `" -export KUBECTL="` + *root + `/cluster/kubectl.sh` + kubeClientArgs() + `" +export KUBECFG="` + *root + `/cluster/kubecfg.sh` + kubecfgArgs() + `" +export KUBECTL="` + *root + `/cluster/kubectl.sh` + kubectlArgs() + `" source "` + *root + `/cluster/kube-env.sh" source "` + *root + `/cluster/${KUBERNETES_PROVIDER}/util.sh"