diff --git a/kyaml/kio/pkgio_reader.go b/kyaml/kio/pkgio_reader.go index 2cb36a50c..a4f364cae 100644 --- a/kyaml/kio/pkgio_reader.go +++ b/kyaml/kio/pkgio_reader.go @@ -328,11 +328,8 @@ func (r *LocalPackageReader) shouldSkipDir(path string, matcher *ignoreFilesMatc return nil } // check if this is a subpackage - _, err := os.Stat(filepath.Join(path, r.PackageFileName)) - if os.IsNotExist(err) { + if !r.FileSystem.Exists(filepath.Join(path, r.PackageFileName)) { return nil - } else if err != nil { - return errors.Wrap(err) } if !r.IncludeSubpackages { return filepath.SkipDir