Skip to content

Commit 5120d31

Browse files
author
Hantao (Will) Wang
committed
Export kubectl path to test
1 parent b45b1e3 commit 5120d31

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/k8s-integration/main.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func handle() error {
214214
}
215215
err = buildKubernetes(testDir, "WHAT=test/e2e/e2e.test")
216216
if err != nil {
217-
return fmt.Errorf("failed to build Kubernetes: %v", err)
217+
return fmt.Errorf("failed to build Kubernetes e2e: %v", err)
218218
}
219219
} else {
220220
testDir = k8sDir
@@ -321,6 +321,12 @@ func runTestsWithConfig(testDir, testFocus, testConfigArg string) error {
321321
homeDir, _ := os.LookupEnv("HOME")
322322
os.Setenv("KUBECONFIG", filepath.Join(homeDir, ".kube/config"))
323323

324+
cmd := exec.Command("export", "KUBECTL_PATH=$(which kubectl)")
325+
err = runCommand("Exporting KUBECTL_PATH", cmd)
326+
if err != nil {
327+
return fmt.Errorf("failed to export kubectl path: %v", err)
328+
}
329+
324330
artifactsDir, _ := os.LookupEnv("ARTIFACTS")
325331
reportArg := fmt.Sprintf("-report-dir=%s", artifactsDir)
326332

@@ -330,9 +336,10 @@ func runTestsWithConfig(testDir, testFocus, testConfigArg string) error {
330336
testConfigArg,
331337
reportArg)
332338

333-
cmd := exec.Command("kubetest",
339+
cmd = exec.Command("kubetest",
334340
"--test",
335341
"--ginkgo-parallel",
342+
"--check-version-skew=false",
336343
fmt.Sprintf("--test_args=%s", kubetestArgs),
337344
)
338345
err = runCommand("Running Tests", cmd)

0 commit comments

Comments
 (0)