This PR adds a new flag --show-tree to both ./kubestr browse snapshot & ./kubestr browse snapshot commands which would enable the users to print the contents of a PVC and VolumeSnapshot in directory tree structure format.
Unit-tested these code changes with new fake tests and mock objects
Tested these code changes by executing the command on a GKE cluster. Please find the output below;
> ./kubestr browse pvc test-pvc1 -n file-level-restore -v test-snapshotclass --show-tree
Taking a snapshot.
Creating the browser pod.
Printing the tree structure from root directory.
/pvc-data
├── lost+found
└── abc.txt
└── time.txt
1 directories, 2 files
Cleaning up resources
> ./kubestr browse snapshot test-snapshot -n file-level-restore -s standard-rwo --show-tree
Fetching the snapshot.
Creating the browser pod.
Printing the tree structure from root directory.
/snapshot-data
├── lost+found
└── abc.txt
└── time.txt
1 directories, 2 files
Cleaning up resources.
We follow the same cleanup procedure for browse snapshot & browse pvc. Which is;
For browse pvc, we clean the snapshot, restore pvc and the browse pod
For browse snapshot, we clean the restore pvc and the browse pod
This PR adds a new flag
--show-tree
to both./kubestr browse snapshot
&./kubestr browse snapshot
commands which would enable the users to print the contents of a PVC and VolumeSnapshot in directory tree structure format.Unit-tested these code changes with new fake tests and mock objects Tested these code changes by executing the command on a GKE cluster. Please find the output below;
We follow the same cleanup procedure for
browse snapshot
&browse pvc
. Which is;browse pvc
, we clean the snapshot, restore pvc and the browse podbrowse snapshot
, we clean the restore pvc and the browse pod