E2E: Add Api Server option to kubectl

pull/6/head
jayunit100 2015-04-20 15:51:16 -04:00
parent 196b3d066d
commit 0f0c0700ff
2 changed files with 8 additions and 1 deletions

View File

@ -54,7 +54,7 @@ var _ = Describe("kubectl", func() {
Describe("update-demo", func() {
var (
updateDemoRoot = filepath.Join(testContext.RepoRoot, "examples/update-demo/v1beta3")
updateDemoRoot = filepath.Join(testContext.RepoRoot, "examples/update-demo")
nautilusPath = filepath.Join(updateDemoRoot, "nautilus-rc.yaml")
kittenPath = filepath.Join(updateDemoRoot, "kitten-rc.yaml")
)

View File

@ -274,9 +274,16 @@ func kubectlCmd(args ...string) *exec.Cmd {
defaultArgs := []string{}
if testContext.KubeConfig != "" {
defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+testContext.KubeConfig)
// Reference the KubeContext
if testContext.KubeContext != "" {
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 != "" {