From 60542e89873e26e1a4173f12d852316825c2e258 Mon Sep 17 00:00:00 2001 From: Brendan Shephard Date: Mon, 29 Jul 2024 11:14:47 +1000 Subject: [PATCH] Fix for Mac There's a second function that encodes the path and needs to also check for the darwin runtime before doing it. This enables tests of operators that import openshift CRD's to run on MacOS platforms. Signed-off-by: Brendan Shephard --- modules/test/crd.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/test/crd.go b/modules/test/crd.go index d47e53ce..84718024 100644 --- a/modules/test/crd.go +++ b/modules/test/crd.go @@ -124,7 +124,7 @@ func GetCRDDirFromModule(moduleName string, goModPath string, relativeCRDPath st path = filepath.Join(build.Default.GOPATH, "pkg", "mod", versionedModule, relativeCRDPath) } - if runtime.GOOS != "Darwin" { + if runtime.GOOS != "darwin" { path, err = encodePath(path) if err != nil { return path, err @@ -147,9 +147,12 @@ func GetOpenShiftCRDDir(crdName string, goModPath string) (string, error) { } versionedModule := fmt.Sprintf("%s@%s", libCommon, version) path := filepath.Join(build.Default.GOPATH, "pkg", "mod", versionedModule, "openshift_crds", crdName) - path, err = encodePath(path) - if err != nil { - return path, err + + if runtime.GOOS != "darwin" { + path, err = encodePath(path) + if err != nil { + return path, err + } } return path, nil