add Kustomization to cfg tree

This commit is contained in:
Donny Xia
2020-09-15 11:14:01 -07:00
parent 103d1461a1
commit 0c0cb9aaba
2 changed files with 53 additions and 2 deletions

View File

@@ -74,13 +74,17 @@ type TreeRunner struct {
structure string
}
func (r *TreeRunner) getMatchFilesGlob() []string {
matchFilesGlob := append([]string{ext.KRMFileName()}, kio.DefaultMatch...)
return append(matchFilesGlob, "Kustomization")
}
func (r *TreeRunner) runE(c *cobra.Command, args []string) error {
var input kio.Reader
var root = "."
matchFilesGlob := append([]string{ext.KRMFileName()}, kio.DefaultMatch...)
if len(args) == 1 {
root = filepath.Clean(args[0])
input = kio.LocalPackageReader{PackagePath: args[0], MatchFilesGlob: matchFilesGlob}
input = kio.LocalPackageReader{PackagePath: args[0], MatchFilesGlob: r.getMatchFilesGlob()}
} else {
input = &kio.ByteReader{Reader: c.InOrStdin()}
}