Merge pull request #12644 from leahneukirchen/events-timestamp

remote events: convert TimeNano properly
This commit is contained in:
OpenShift Merge Robot
2022-01-13 15:26:53 +01:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,7 @@ func ConvertToLibpodEvent(e Event) *libpodEvents.Event {
Image: image, Image: image,
Name: name, Name: name,
Status: status, Status: status,
Time: time.Unix(e.Time, e.TimeNano), Time: time.Unix(0, e.TimeNano),
Type: t, Type: t,
Details: libpodEvents.Details{ Details: libpodEvents.Details{
Attributes: details, Attributes: details,

View File

@ -62,6 +62,8 @@ var _ = Describe("Podman events", func() {
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0)) Expect(result).Should(Exit(0))
Expect(len(result.OutputToStringArray())).To(BeNumerically(">=", 1), "Number of events") 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() { It("podman events with an event filter and container=cid", func() {