From be34714cb14113b1c14b8a6af71c8a27c2dbb44b Mon Sep 17 00:00:00 2001 From: jayunit100 Date: Tue, 21 Apr 2015 10:07:08 -0400 Subject: [PATCH] Use --host option even if kubecontext is not provided. --- test/e2e/util.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/e2e/util.go b/test/e2e/util.go index bec437a3185..afb46e59f9b 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -272,6 +272,11 @@ func validateController(c *client.Client, containerImage string, replicas int, c // kubectlCmd runs the kubectl executable. func kubectlCmd(args ...string) *exec.Cmd { defaultArgs := []string{} + + // Reference a --server option so tests can run anywhere. + if testContext.Host != "" { + defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAPIServer+"="+testContext.Host) + } if testContext.KubeConfig != "" { defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+testContext.KubeConfig) @@ -280,10 +285,6 @@ func kubectlCmd(args ...string) *exec.Cmd { defaultArgs = append(defaultArgs, "--"+clientcmd.FlagContext+"="+testContext.KubeContext) } - // Reference a --server option so tests can run anywhere. - if testContext.Host != "" { - defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAPIServer+"="+testContext.Host) - } } else { defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAuthPath+"="+testContext.AuthConfig) if testContext.CertDir != "" {