From 927568eea286670799cdca97c7ca9a38c12366ac Mon Sep 17 00:00:00 2001 From: Francesc Campoy Date: Fri, 16 Jul 2021 09:27:20 -0700 Subject: [PATCH] Replace os.Stat call with FileSystem.Exists --- kyaml/kio/pkgio_reader.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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