mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
E2E: Add Api Server option to kubectl
This commit is contained in:
parent
196b3d066d
commit
0f0c0700ff
@ -54,7 +54,7 @@ var _ = Describe("kubectl", func() {
|
|||||||
|
|
||||||
Describe("update-demo", func() {
|
Describe("update-demo", func() {
|
||||||
var (
|
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")
|
nautilusPath = filepath.Join(updateDemoRoot, "nautilus-rc.yaml")
|
||||||
kittenPath = filepath.Join(updateDemoRoot, "kitten-rc.yaml")
|
kittenPath = filepath.Join(updateDemoRoot, "kitten-rc.yaml")
|
||||||
)
|
)
|
||||||
|
@ -274,9 +274,16 @@ func kubectlCmd(args ...string) *exec.Cmd {
|
|||||||
defaultArgs := []string{}
|
defaultArgs := []string{}
|
||||||
if testContext.KubeConfig != "" {
|
if testContext.KubeConfig != "" {
|
||||||
defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+testContext.KubeConfig)
|
defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+testContext.KubeConfig)
|
||||||
|
|
||||||
|
// Reference the KubeContext
|
||||||
if testContext.KubeContext != "" {
|
if testContext.KubeContext != "" {
|
||||||
defaultArgs = append(defaultArgs, "--"+clientcmd.FlagContext+"="+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 {
|
} else {
|
||||||
defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAuthPath+"="+testContext.AuthConfig)
|
defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAuthPath+"="+testContext.AuthConfig)
|
||||||
if testContext.CertDir != "" {
|
if testContext.CertDir != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user