From d3ae6c2df3ccc0df255904a0ba3c9d8c25e3cfa3 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 6 Apr 2023 10:13:28 -0400 Subject: [PATCH] Specify KUBE_ROOT for test-e2e-node/AWS to work test-e2e-node for AWS is out-of-tree so that we won't need to vendor in AWS related packages. For this to work, some of the scripts/golang code need to know where the k8s tree is git cloned. So let's add an option to lookup the env var, so that we can then, change directory to this specified directory to run some make commands Signed-off-by: Davanum Srinivas --- test/utils/paths.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/utils/paths.go b/test/utils/paths.go index 9f1f6f5da34..a980cda733c 100644 --- a/test/utils/paths.go +++ b/test/utils/paths.go @@ -27,6 +27,11 @@ import ( // GetK8sRootDir returns the root directory for kubernetes, if present in the gopath. func GetK8sRootDir() (string, error) { + dir := os.Getenv("KUBE_ROOT") + if len(dir) > 0 { + return dir, nil + } + dir, err := RootDir() if err != nil { return "", err