Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recursively add metadata JSON fields to the tree
Some annotations contain a JSON string. This string may include nested arrays and maps. This patch updates addPodInfoToTree() to recursively add these fields to the output tree using pretty print. Before: ├── kubectl.kubernetes.io/last-applied-configuration │ ├── metadata: map[annotations:map[] name:counter-pod namespace:default] │ ├── spec: map[containers:[map[args:[-c i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done] command:[sh] image:busybox:latest name:counter-container]]] After: ├── kubectl.kubernetes.io/last-applied-configuration │ ├── apiVersion: v1 │ ├── kind: Pod │ ├── metadata: │ │ ├── annotations: │ │ ├── name: counter-pod │ │ └── namespace: default │ └── spec: │ └── containers: │ └── [0]: │ ├── args: │ │ ├── [0]: -c │ │ └── [1]: i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done │ ├── command: │ │ └── [0]: sh │ ├── image: busybox:latest │ └── name: counter-container Signed-off-by: Radostin Stoyanov <[email protected]>
- Loading branch information