diff --git a/test/k8s-integration/driver.go b/test/k8s-integration/driver.go index 0481e8ad6..4b9032348 100644 --- a/test/k8s-integration/driver.go +++ b/test/k8s-integration/driver.go @@ -27,19 +27,17 @@ func installDriver(testParams *testParameters, stagingImage, deployOverlayName s // Edit ci kustomization to use given image tag overlayDir := getOverlayDir(testParams.pkgDir, deployOverlayName) - err = os.Chdir(overlayDir) - if err != nil { - return fmt.Errorf("failed to change to overlay directory: %s, err: %v", out, err.Error()) - } // TODO (#138): in a local environment this is going to modify the actual kustomize files. // maybe a copy should be made instead - out, err = exec.Command( + kustomizeCommand := exec.Command( filepath.Join(testParams.pkgDir, "bin", "kustomize"), "edit", "set", "image", - fmt.Sprintf("%s=%s:%s", pdImagePlaceholder, stagingImage, testParams.stagingVersion)).CombinedOutput() + fmt.Sprintf("%s=%s:%s", pdImagePlaceholder, stagingImage, testParams.stagingVersion)) + kustomizeCommand.Dir = overlayDir + out, err = kustomizeCommand.CombinedOutput() if err != nil { return fmt.Errorf("failed to edit kustomize: %s, err: %v", out, err.Error()) } diff --git a/test/k8s-integration/main.go b/test/k8s-integration/main.go index 811f23ad6..9edb0ef52 100644 --- a/test/k8s-integration/main.go +++ b/test/k8s-integration/main.go @@ -867,16 +867,11 @@ func runTestsWithConfig(testParams *testParameters, testConfigArg, reportPrefix // path sent to kubetest2 through its --artifacts path // pkg/_artifacts is the default value that kubetests uses for --artifacts - kubernetesTestBinariesPath := filepath.Join(testParams.pkgDir, "_artifacts") - if kubetestDumpDir != "" { - // a custom artifacts dir was set - kubernetesTestBinariesPath = kubetestDumpDir - } + kubernetesTestBinariesPath := filepath.Join(testParams.pkgDir, "_rundir") kubernetesTestBinariesPath = filepath.Join(kubernetesTestBinariesPath, runID) klog.Infof("Copying kubernetes binaries to path=%s to run the tests", kubernetesTestBinariesPath) - err := copyKubernetesTestBinaries(testParams.k8sSourceDir, kubernetesTestBinariesPath) - if err != nil { + if err := copyKubernetesTestBinaries(testParams.k8sSourceDir, kubernetesTestBinariesPath); err != nil { return fmt.Errorf("failed to copy the kubernetes test binaries, err=%v", err.Error()) } kubeTest2Args = append(kubeTest2Args, "--use-built-binaries")