-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sort output of resource list in velero backup describe --details
#1731
Comments
Do you think the list should be sorted before storing in object storage or just before displaying in the client? |
I'd probably sort before storing - means it only has to be done once vs. every time it's read, plus then it's sorted for anyone who looks at the file directly. |
FYI the GVK list is already sorted, which is expected as per json.Marshal documentation
So the only thing we need to do is make sure that the resources within each GVK list is sorted. |
Hmm, I'm seeing output like this (GVKs not sorted):
|
Hmm you're right, it happened to be sorted correctly for me, just checked with a full-namespace backup however and it wasn't sorted. Looking into this |
For some reason I'm not able to reproduce this when trying to encode the same map in the Go playground: https://play.golang.org/p/HdhttP8bOlL |
Maybe an issue on the decode? golang/go#27179 |
Yep, can confirm that it's sorted properly in the file in obj storage, but not in the |
So much for sort once :/ |
Ah of course, thanks for helping track that down! At least we only need to sort the GVK keys, the resource lists within each GVK should have their order preserved. I'll update #1741 to sort the GVKs when printing. |
It would be nice to sort the resource list in
velero backup describe --details
-- both the GVK list, and then the resources within each GVK list.The text was updated successfully, but these errors were encountered: