mirror of https://github.com/k3s-io/k3s
Use --host option even if kubecontext is not provided.
parent
0f0c0700ff
commit
be34714cb1
|
@ -272,6 +272,11 @@ func validateController(c *client.Client, containerImage string, replicas int, c
|
||||||
// kubectlCmd runs the kubectl executable.
|
// kubectlCmd runs the kubectl executable.
|
||||||
func kubectlCmd(args ...string) *exec.Cmd {
|
func kubectlCmd(args ...string) *exec.Cmd {
|
||||||
defaultArgs := []string{}
|
defaultArgs := []string{}
|
||||||
|
|
||||||
|
// Reference a --server option so tests can run anywhere.
|
||||||
|
if testContext.Host != "" {
|
||||||
|
defaultArgs = append(defaultArgs, "--"+clientcmd.FlagAPIServer+"="+testContext.Host)
|
||||||
|
}
|
||||||
if testContext.KubeConfig != "" {
|
if testContext.KubeConfig != "" {
|
||||||
defaultArgs = append(defaultArgs, "--"+clientcmd.RecommendedConfigPathFlag+"="+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)
|
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