Skip to content

Commit

Permalink
Fix for Mac
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bshephar authored and averdagu committed Aug 9, 2024
1 parent f765d58 commit d457835
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/test/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d457835

Please sign in to comment.