Skip to content

Commit

Permalink
Fix order of recursive directory check
Browse files Browse the repository at this point in the history
  • Loading branch information
jgustie committed Mar 9, 2021
1 parent 3e4dedd commit 81be57d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/readers/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ func (r *FileReader) Read() ([]*yaml.RNode, error) {
}

if info.IsDir() {
// Determine if we are allowed to recurse into the directory
if !r.Recurse && path != root {
return filepath.SkipDir
}

// Check to see if a directory is a Kustomize root
if isKustomizeRoot(path) {
n, err := konjurev1beta2.GetRNode(&konjurev1beta2.Kustomize{Root: path})
Expand All @@ -65,11 +70,6 @@ func (r *FileReader) Read() ([]*yaml.RNode, error) {
return filepath.SkipDir
}

// Determine if we are allowed to recurse into the directory
if !r.Recurse && path != root {
return filepath.SkipDir
}

return nil
}

Expand Down

0 comments on commit 81be57d

Please sign in to comment.