fix e2e.go args for kubectl

This commit is contained in:
Daniel Smith 2014-11-12 13:30:53 -08:00
parent 178d0af795
commit 4e1ab8045b

View File

@ -216,13 +216,22 @@ func finishRunning(stepName string, cmd *exec.Cmd) bool {
// returns either "", or a list of args intended for appending with the // returns either "", or a list of args intended for appending with the
// kubecfg or kubectl commands (begining with a space). // kubecfg or kubectl commands (begining with a space).
func kubeClientArgs() string { func kubecfgArgs() string {
if *checkVersionSkew { if *checkVersionSkew {
return " -expect_version_match" return " -expect_version_match"
} }
return "" 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 { func bashWrap(cmd string) string {
return ` return `
set -o errexit 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 # TODO(jbeda): This will break on usage if there is a space in
# ${KUBE_ROOT}. Covert to an array? Or an exported function? # ${KUBE_ROOT}. Covert to an array? Or an exported function?
export KUBECFG="` + *root + `/cluster/kubecfg.sh` + kubeClientArgs() + `" export KUBECFG="` + *root + `/cluster/kubecfg.sh` + kubecfgArgs() + `"
export KUBECTL="` + *root + `/cluster/kubectl.sh` + kubeClientArgs() + `" export KUBECTL="` + *root + `/cluster/kubectl.sh` + kubectlArgs() + `"
source "` + *root + `/cluster/kube-env.sh" source "` + *root + `/cluster/kube-env.sh"
source "` + *root + `/cluster/${KUBERNETES_PROVIDER}/util.sh" source "` + *root + `/cluster/${KUBERNETES_PROVIDER}/util.sh"