mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
remote events: convert TimeNano properly
e.TimeNano contains nanoseconds since epoch, not just the nanoseconds after e.Time. time.Unix supports nanoseconds > 999999999 and converts them to seconds, so just passing e.TimeNano is enough. Signed-off-by: Leah Neukirchen <leah@vuxu.org>
This commit is contained in:
@ -42,7 +42,7 @@ func ConvertToLibpodEvent(e Event) *libpodEvents.Event {
|
||||
Image: image,
|
||||
Name: name,
|
||||
Status: status,
|
||||
Time: time.Unix(e.Time, e.TimeNano),
|
||||
Time: time.Unix(0, e.TimeNano),
|
||||
Type: t,
|
||||
Details: libpodEvents.Details{
|
||||
Attributes: details,
|
||||
|
@ -62,6 +62,8 @@ var _ = Describe("Podman events", func() {
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(Exit(0))
|
||||
Expect(len(result.OutputToStringArray())).To(BeNumerically(">=", 1), "Number of events")
|
||||
date := time.Now().Format("2006-01-02")
|
||||
Expect(result.OutputToStringArray()).To(ContainElement(HavePrefix(date)), "event log has correct timestamp")
|
||||
})
|
||||
|
||||
It("podman events with an event filter and container=cid", func() {
|
||||
|
Reference in New Issue
Block a user