Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
eddycharly committed Apr 18, 2024
1 parent 9fa5b31 commit c27bbe7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/openapiclient/local_schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"io/fs"
"os"
"path"
"strings"

Expand Down Expand Up @@ -32,7 +33,7 @@ func (k *localSchemasClient) Paths() (map[string]openapi.GroupVersion, error) {
}
res := map[string]openapi.GroupVersion{}
apiGroups, err := fs.ReadDir(k.fs, "apis")
if err != nil && !errors.Is(err, fs.ErrNotExist) {
if err != nil && !(errors.Is(err, fs.ErrNotExist) || os.IsNotExist(err)) {
return nil, fmt.Errorf("failed reading local files dir %s: %w", "apis", err)
}
for _, f := range apiGroups {
Expand All @@ -51,7 +52,7 @@ func (k *localSchemasClient) Paths() (map[string]openapi.GroupVersion, error) {
}
}
coregroup, err := fs.ReadDir(k.fs, "api")
if err != nil && !errors.Is(err, fs.ErrNotExist) {
if err != nil && !(errors.Is(err, fs.ErrNotExist) || os.IsNotExist(err)) {
return nil, fmt.Errorf("failed reading local files dir %s: %w", "api", err)
}
for _, v := range coregroup {
Expand Down

0 comments on commit c27bbe7

Please sign in to comment.