libpod/events: Use unix timestamp for event time, and add a timeNano field for event time in nanoseconds#18549
Conversation
There was a problem hiding this comment.
Please keep the golang native separate from the githup imports.
|
Thanks @ch33hau |
|
Changes LGTM once @rhatdan 's comment is addressed and the tests are made happy. |
8cdb0f3 to
ead1cf4
Compare
|
Thanks for reviewing, @rhatdan @TomSweeneyRedHat ! @rhatdan I think your comment about the I have fixed that linter complaint as well as some bugs (should use By the way, I have a side question which is not directly related to this issue: I will keep investigating how I can make it works but just wanted to ask you if you by chance have any ideas to deal with these problems. (I tried to search from Github issues but seems no other people have similar issues) Thanks a lot for your time! |
ead1cf4 to
66395eb
Compare
|
/retest |
|
@ch33hau: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
66395eb to
1473bef
Compare
- Use unix timestamp for event time - Add a timeNano field for event time in nanoseconds Fixes: containers#14993 Signed-off-by: Chee Hau Lim <ch33hau@gmail.com>
1473bef to
ec0668a
Compare
|
This seems to break API? |
|
Still working on fixing |
Yes. The Event struct is used in the REST API, so we need to keep it stable. Looking at #14993, I am not we can guarantee compatibility on the raw JSON level. Was there a concrete issue or bug caused by the differences or is it more of a cosmetic nature? |
@edsantiago @vrothberg thanks for mentioning the API changes. That sounds like I should on-hold the changes until a decision has been made, right? |
The issue links https://github.com/stepchowfun/docuum Looking at #14993 the docker json output is all lowercase, so technically we could add new fields as lowercase. Converting the timestamp can be done on the client side. Breaking the internal event type must be avoided, this would result in a newer client unable to read the events from the event file. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@vrothberg Sorry that I am pretty new to Podman so I might not totally get your question correctly. What I learned from #14993 was that a user is asking if Podman is trying to match Docker's outputs, because the user is facing some issues when using a tool that is working fine with Docker but not Podman. And then this comment says that |
|
|
||
| now := time.Now() | ||
| event.Time = now.Unix() | ||
| event.TimeNano = now.UnixNano() |
There was a problem hiding this comment.
Alternatively use events.new(status).
|
The unix time can be added to the json but only in the frontend, i.e. cmd/podman/system/events.go. We cannot break our internal structure here, this is also used via our libpod rest API. You could embed the |
|
A friendly reminder that this PR had no activity for 30 days. |
|
Friendly ping. @ch33hau, do you have cycles to complete this PR? |
vrothberg
left a comment
There was a problem hiding this comment.
Closing this PR due to inactivity. Feel free to reopen or others to take over and create a new PR.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ch33hau, vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes: #14993
Does this PR introduce a user-facing change?
Yes