mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Don't print Kustomization file in tree output
This commit is contained in:
@@ -75,11 +75,6 @@ type TreeRunner struct {
|
|||||||
structure string
|
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 {
|
func (r *TreeRunner) runE(c *cobra.Command, args []string) error {
|
||||||
var input kio.Reader
|
var input kio.Reader
|
||||||
var root = "."
|
var root = "."
|
||||||
@@ -90,7 +85,7 @@ func (r *TreeRunner) runE(c *cobra.Command, args []string) error {
|
|||||||
input = &kio.ByteReader{Reader: c.InOrStdin()}
|
input = &kio.ByteReader{Reader: c.InOrStdin()}
|
||||||
} else {
|
} else {
|
||||||
root = filepath.Clean(args[0])
|
root = filepath.Clean(args[0])
|
||||||
input = kio.LocalPackageReader{PackagePath: args[0], MatchFilesGlob: r.getMatchFilesGlob()}
|
input = kio.LocalPackageReader{PackagePath: args[0]}
|
||||||
}
|
}
|
||||||
|
|
||||||
var fields []kio.TreeWriterField
|
var fields []kio.TreeWriterField
|
||||||
|
|||||||
@@ -208,7 +208,6 @@ resources:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !assert.Equal(t, fmt.Sprintf(`%s
|
if !assert.Equal(t, fmt.Sprintf(`%s
|
||||||
├── [Kustomization] Kustomization
|
|
||||||
└── [f2.yaml] Deployment bar
|
└── [f2.yaml] Deployment bar
|
||||||
`, d), b.String()) {
|
`, d), b.String()) {
|
||||||
return
|
return
|
||||||
@@ -307,11 +306,9 @@ openAPI:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !assert.Equal(t, fmt.Sprintf(`%s
|
if !assert.Equal(t, fmt.Sprintf(`%s
|
||||||
├── [Krmfile] Krmfile mainpkg
|
|
||||||
├── [f1.yaml] Deployment foo
|
├── [f1.yaml] Deployment foo
|
||||||
├── [f1.yaml] Service foo
|
├── [f1.yaml] Service foo
|
||||||
└── Pkg: subpkg
|
└── Pkg: subpkg
|
||||||
├── [Krmfile] Krmfile subpkg
|
|
||||||
└── [f2.yaml] Deployment bar
|
└── [f2.yaml] Deployment bar
|
||||||
`, d), b.String()) {
|
`, d), b.String()) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user