Skip to content

Using --sort-by="..." to sort by a timestamp field yields "unsortable type: struct" exception #24328

Closed
@timbunce

Description

I'd like to be able to sort by a timestamp, e.g. kubectl get rs --sort-by=metadata.creationTimestamp
but that fails with an exception:

F0415 11:01:43.681401   30235 sorting_printer.go:182] Field {.metadata.creationTimestamp}
in ... is an unsortable type: struct, err: unsortable type: struct

I appreciate that the root of the problem is probably outside of kubernetes, yet I hope you'd agree that sorting by a timestamp is very useful functionality.

Metadata

Assignees

No one assigned

    Labels

    area/kubectlpriority/backlogHigher priority than priority/awaiting-more-evidence.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions