You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Alphabetic sorting expected. Above two namespaces will sort correctly with kubectl, but in k9s namespace view will be in wrong order. Other namespaces order just fine, only issues with namespaces that contain uuid's
Screenshots
Versions (please complete the following information):
OS: Fedora 41
K9s: 0.32.7 (via brew)
K8s: multiple
The text was updated successfully, but these errors were encountered:
kubectl without --sort-by: There is no enforced order when listing resources. The order may appear arbitrary depending on how the API server returns results.
kubectl --sort-by=<field>: When specifying a field (e.g., --sort-by=.metadata.name), kubectl sorts lexicographically. Ref: sorter.go#L181
k9s ordering: k9s applies natural sorting, which ensures that "pod2" comes before "pod10" instead of after it (as it would in lexicographic order). Ref: helpers.go#L142
So the issue is more with any numbers in the name. I guess in the end, this is more about preference—whether you want lexicographic or natural sorting.
Describe the bug
Alphabetic sorting of namespaces containing UUID's incorrect
To Reproduce
Create a few namespaces of format project-{$uuid}
Expected behavior
Alphabetic sorting expected. Above two namespaces will sort correctly with kubectl, but in k9s namespace view will be in wrong order. Other namespaces order just fine, only issues with namespaces that contain uuid's
Screenshots
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: