Commit 681e47e5 authored by Zach Loafman's avatar Zach Loafman

Merge pull request #7065 from jayunit100/kubectl-1

E2E: Add Api Server option to kubectl
parents f48d7ad7 0f0c0700
......@@ -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")
)
......
......@@ -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 != "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment