kubectl/pkg/cmd/top
brianpursley f9c04a0266 Sort kubectl top output when --sort-by and --containers are used together
- Changed kubectl top to sort first at the pod level and then at the container level when --sort-by and --containers are used together.
- Refactored printSinglePodMetrics into two separate functions instead of passing in bool to change behavior.
- Refactored MetricsSorters to simplify code.
- Added unit tests to test container sorting.
- Fixed pod sorting unit tests which were not working because it was checking for --sort-by command line flag which was never true.

Kubernetes-commit: 04266b37ded103ddb84a192ec816499904fce1d1
2020-08-06 11:47:09 -04:00
..
top.go Fix help text in kubectl top -h 2019-09-27 23:05:02 +08:00
top_node.go Staticcheck: vendor/k8s.io/kubectl/pkg/scale|describe/versioned|cmd/top|cmd/util/editor|cmd/top 2020-01-21 10:13:10 +08:00
top_node_test.go test: kubectl unit tests should be using codecs without conversion 2019-11-03 15:20:10 -05:00
top_pod.go switch over k/k to use klog v2 2020-04-17 15:25:06 -04:00
top_pod_test.go Sort kubectl top output when --sort-by and --containers are used together 2020-08-06 11:47:09 -04:00
top_test.go Fix kubectl top sort-by cpu and sort-by memory options 2019-09-04 16:28:21 +02:00