Merge pull request #7239 from tstromberg/validateMinikubeKubectl

validateMinikubeKubectl: Pass profile to minikube and kubectl commands
pull/7219/head^2
Thomas Strömberg 2020-03-25 15:59:33 -07:00 committed by GitHub
commit e1df1fbbad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -233,7 +233,8 @@ func validateKubectlGetPods(ctx context.Context, t *testing.T, profile string) {
// validateMinikubeKubectl validates that the `minikube kubectl` command returns content
func validateMinikubeKubectl(ctx context.Context, t *testing.T, profile string) {
kubectlArgs := []string{"kubectl", "--", "get", "pods"}
// Must set the profile so that it knows what version of Kubernetes to use
kubectlArgs := []string{"-p", profile, "kubectl", "--", "--context", profile, "get", "pods"}
rr, err := Run(t, exec.CommandContext(ctx, Target(), kubectlArgs...))
if err != nil {
t.Fatalf("%s failed: %v", rr.Args, err)