-
Notifications
You must be signed in to change notification settings - Fork 456
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
Rewrite timestamps in container/sandbox status. #211
Rewrite timestamps in container/sandbox status. #211
Conversation
Signed-off-by: Lantao Liu <[email protected]>
/cc @mikebrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good as one solution to resolve the map order issue. But as seen over here:
containerd/cri#475
We don't really want a map or array of verbose info that is not specified with a predefined field name.
Per the solution used above ^ isn't it much better/easier to just deprecate map and add predefined verbose info structs? Even if we go with map we still need predefined map keys so we know what to look for if we are interested in something specific. And if we go that route we could output the fields we want in any sequence we want. So either way, predefined struct, or predefined keys.. we would not need to sort. Thoughts?
if err != nil { | ||
return "", err | ||
} | ||
jsonMap["createdAt"] = time.Unix(0, cs.CreatedAt).Format(time.RFC3339Nano) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thumbs up!
Predefined struct or keys are other ways for getting a sorted result. But they need to redefine the sandbox/container/image status structs or hack with struct fields, which seems also not graceful. I'm ok with current implementation. Let's get this in and iterate with better solutions in the future (if there are). |
Rewrite timestamps in status to make it more user friendly. After this change:
Signed-off-by: Lantao Liu [email protected]