mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-03-18 00:22:29 -04:00
Automatic merge from submit-queue (batch tested with PRs 68051, 68130, 67211, 68065, 68117). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Update `kubectl get` sorter to deal with server-side printing **Release note**: ```release-note NONE ``` ### Why? Currently, we default to non-server-side printing when sorting items in `kubectl get`. This means that instead of taking advantage of having the server tell `kubectl` how to display information, `kubectl` falls back to using hardcoded resource types to figure out how to print its output. This does not really work with resources that `kubectl` does not know about, and it goes against our goal of snipping any dependencies that `kubectl` has on the core repo. This patch adds a sorter capable of dealing with Table objects sent by the server when using "server-side printing". A few things left to take care of: - ~~[ ] When printing `all` resources, this implementation does not handle sorting every single Table object, but rather _only_ the rows in each object. As a result, output will contain sorted resources of the same _kind_, but the overall list of mixed resources will _not_ itself be sorted. Example:~~ ```bash $ kubectl get all --sort-by .metadata.name NAME READY STATUS RESTARTS AGE # pods here will be sorted: pod/bar 0/2 Pending 0 31m pod/foo 1/1 Running 0 37m NAME DESIRED CURRENT READY AGE # replication controllers here will be sorted as well: replicationcontroller/baz 1 1 1 37m replicationcontroller/buz 1 1 1 37m # ... but the overall mixed list of rc's and pods will not be sorted ``` This occurs because each Table object received from the server contains all rows for that resource _kind_. We would need a way to build an ambiguous Table object containing all rows for all objects regardless of their type to have a fully sorted mixed-object output. - [ ] handle sorting by column-names, rather than _only_ with jsonpaths (Tracked in https://github.com/kubernetes/kubernetes/issues/68027) cc @soltysh @kubernetes/sig-cli-maintainers @seans3 @mengqiy |
||
|---|---|---|
| .. | ||
| auth | ||
| config | ||
| create | ||
| get | ||
| rollout | ||
| scalejob | ||
| set | ||
| templates | ||
| testdata | ||
| testing | ||
| util | ||
| wait | ||
| alpha.go | ||
| annotate.go | ||
| annotate_test.go | ||
| apiresources.go | ||
| apiversions.go | ||
| apply.go | ||
| apply_edit_last_applied.go | ||
| apply_set_last_applied.go | ||
| apply_test.go | ||
| apply_view_last_applied.go | ||
| attach.go | ||
| attach_test.go | ||
| autoscale.go | ||
| BUILD | ||
| certificates.go | ||
| clusterinfo.go | ||
| clusterinfo_dump.go | ||
| clusterinfo_dump_test.go | ||
| cmd.go | ||
| cmd_printing_test.go | ||
| cmd_test.go | ||
| completion.go | ||
| convert.go | ||
| convert_test.go | ||
| cp.go | ||
| cp_test.go | ||
| delete.go | ||
| delete_flags.go | ||
| delete_test.go | ||
| describe.go | ||
| describe_test.go | ||
| diff.go | ||
| diff_test.go | ||
| drain.go | ||
| drain_test.go | ||
| edit.go | ||
| edit_test.go | ||
| exec.go | ||
| exec_test.go | ||
| explain.go | ||
| expose.go | ||
| expose_test.go | ||
| help.go | ||
| label.go | ||
| label_test.go | ||
| logs.go | ||
| logs_test.go | ||
| options.go | ||
| patch.go | ||
| patch_test.go | ||
| plugin.go | ||
| portforward.go | ||
| portforward_test.go | ||
| proxy.go | ||
| replace.go | ||
| replace_test.go | ||
| rollingupdate.go | ||
| rollingupdate_test.go | ||
| run.go | ||
| run_test.go | ||
| scale.go | ||
| taint.go | ||
| taint_test.go | ||
| top.go | ||
| top_node.go | ||
| top_node_test.go | ||
| top_pod.go | ||
| top_pod_test.go | ||
| top_test.go | ||
| version.go | ||