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]>
(cherry picked from commit 60542e8)
  • Loading branch information
bshephar authored and stuggi committed Sep 4, 2024
1 parent 4013011 commit 64efb3c
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 64efb3c

Please sign in to comment.