Skip to content

Commit 60542e8

Browse files
committed
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 <[email protected]>
1 parent 984575e commit 60542e8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

modules/test/crd.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func GetCRDDirFromModule(moduleName string, goModPath string, relativeCRDPath st
124124
path = filepath.Join(build.Default.GOPATH, "pkg", "mod", versionedModule, relativeCRDPath)
125125
}
126126

127-
if runtime.GOOS != "Darwin" {
127+
if runtime.GOOS != "darwin" {
128128
path, err = encodePath(path)
129129
if err != nil {
130130
return path, err
@@ -147,9 +147,12 @@ func GetOpenShiftCRDDir(crdName string, goModPath string) (string, error) {
147147
}
148148
versionedModule := fmt.Sprintf("%s@%s", libCommon, version)
149149
path := filepath.Join(build.Default.GOPATH, "pkg", "mod", versionedModule, "openshift_crds", crdName)
150-
path, err = encodePath(path)
151-
if err != nil {
152-
return path, err
150+
151+
if runtime.GOOS != "darwin" {
152+
path, err = encodePath(path)
153+
if err != nil {
154+
return path, err
155+
}
153156
}
154157

155158
return path, nil

0 commit comments

Comments
 (0)