import "sigs.k8s.io/kustomize/kyaml/pathutil"
pathutil.go
func DirsWithFile(root, fileName string, recurse bool) ([]string, error)
DirsWithFile takes the root directory path and returns all the paths of sub-directories(including itself) which contain file with input fileName at top level if recurse is true