diff --git a/pkg/openapiclient/local_schemas.go b/pkg/openapiclient/local_schemas.go index 674952a7..de8f3a79 100644 --- a/pkg/openapiclient/local_schemas.go +++ b/pkg/openapiclient/local_schemas.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "io/fs" + "os" "path" "strings" @@ -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 { @@ -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 {