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 <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2023-04-06 10:13:28 -04:00
parent e7e7532a05
commit d3ae6c2df3
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59

View File

@ -27,6 +27,11 @@ import (
// GetK8sRootDir returns the root directory for kubernetes, if present in the gopath. // GetK8sRootDir returns the root directory for kubernetes, if present in the gopath.
func GetK8sRootDir() (string, error) { func GetK8sRootDir() (string, error) {
dir := os.Getenv("KUBE_ROOT")
if len(dir) > 0 {
return dir, nil
}
dir, err := RootDir() dir, err := RootDir()
if err != nil { if err != nil {
return "", err return "", err