mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
config tree defaults to graph structure when ownerRefs available
This commit is contained in:
@@ -20,8 +20,9 @@ container names, etc.
|
||||
|
||||
kustomize config tree supports printing arbitrary fields using the '--field' flag.
|
||||
|
||||
By default, kustomize config tree uses the directory structure for the tree structure, however when printing
|
||||
from the cluster, the Resource graph structure may be used instead.
|
||||
By default, kustomize config tree uses Resource graph structure if any relationships between resources (ownerReferences)
|
||||
are detected, as is typically the case when printing from a cluster. Otherwise, directory graph structure is used. The
|
||||
graph structure can also be selected explicitly using the '--graph-structure' flag.
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -42,8 +43,7 @@ from the cluster, the Resource graph structure may be used instead.
|
||||
--field="status.conditions[type=Completed].status"
|
||||
|
||||
# print live Resources from a cluster using owners for graph structure
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image \
|
||||
--graph-structure=owners
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image
|
||||
|
||||
# print live Resources with status condition fields
|
||||
kubectl get all -o yaml | kustomize config tree \
|
||||
|
||||
@@ -45,7 +45,7 @@ func GetTreeRunner(name string) *TreeRunner {
|
||||
"if true, include local-config in the output.")
|
||||
c.Flags().BoolVar(&r.excludeNonLocal, "exclude-non-local", false,
|
||||
"if true, exclude non-local-config in the output.")
|
||||
c.Flags().StringVar(&r.structure, "graph-structure", "directory",
|
||||
c.Flags().StringVar(&r.structure, "graph-structure", "",
|
||||
"Graph structure to use for printing the tree. may be any of: "+
|
||||
strings.Join(kio.GraphStructures, ","))
|
||||
|
||||
|
||||
@@ -460,8 +460,9 @@ container names, etc.
|
||||
|
||||
kustomize config tree supports printing arbitrary fields using the '--field' flag.
|
||||
|
||||
By default, kustomize config tree uses the directory structure for the tree structure, however when printing
|
||||
from the cluster, the Resource graph structure may be used instead.
|
||||
By default, kustomize config tree uses Resource graph structure if any relationships between resources (ownerReferences)
|
||||
are detected, as is typically the case when printing from a cluster. Otherwise, directory graph structure is used. The
|
||||
graph structure can also be selected explicitly using the '--graph-structure' flag.
|
||||
`
|
||||
var TreeExamples = `
|
||||
# print Resources using directory structure
|
||||
@@ -481,8 +482,7 @@ var TreeExamples = `
|
||||
--field="status.conditions[type=Completed].status"
|
||||
|
||||
# print live Resources from a cluster using owners for graph structure
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image \
|
||||
--graph-structure=owners
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image
|
||||
|
||||
# print live Resources with status condition fields
|
||||
kubectl get all -o yaml | kustomize config tree \
|
||||
|
||||
Reference in New Issue
Block a user