From e46a8f048a459dc6e8c1b1ab5a6a57709571ebe7 Mon Sep 17 00:00:00 2001 From: Gyuho Lee <6799218+gyuho@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:26:33 +0800 Subject: [PATCH] feat(nvidia): set components/events timestamp in UTC explicitly (#227) Signed-off-by: Gyuho Lee --- components/accelerator/nvidia/error-xid-sxid/component.go | 4 ++-- components/accelerator/nvidia/hw-slowdown/component.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/accelerator/nvidia/error-xid-sxid/component.go b/components/accelerator/nvidia/error-xid-sxid/component.go index cc05110c..ca39d282 100644 --- a/components/accelerator/nvidia/error-xid-sxid/component.go +++ b/components/accelerator/nvidia/error-xid-sxid/component.go @@ -83,7 +83,7 @@ func (c *component) Events(ctx context.Context, since time.Time) ([]components.E xidBytes, _ := xidDetail.JSON() convertedEvents = append(convertedEvents, components.Event{ - Time: metav1.Time{Time: time.Unix(event.UnixSeconds, 0)}, + Time: metav1.Time{Time: time.Unix(event.UnixSeconds, 0).UTC()}, Name: EventNameErroXid, Message: msg, ExtraInfo: map[string]string{ @@ -104,7 +104,7 @@ func (c *component) Events(ctx context.Context, since time.Time) ([]components.E sxidBytes, _ := sxidDetail.JSON() convertedEvents = append(convertedEvents, components.Event{ - Time: metav1.Time{Time: time.Unix(event.UnixSeconds, 0)}, + Time: metav1.Time{Time: time.Unix(event.UnixSeconds, 0).UTC()}, Name: EventNameErroSXid, Message: msg, ExtraInfo: map[string]string{ diff --git a/components/accelerator/nvidia/hw-slowdown/component.go b/components/accelerator/nvidia/hw-slowdown/component.go index 9c1b7388..7c9a31e0 100644 --- a/components/accelerator/nvidia/hw-slowdown/component.go +++ b/components/accelerator/nvidia/hw-slowdown/component.go @@ -125,7 +125,7 @@ func (c *component) Events(ctx context.Context, since time.Time) ([]components.E convertedEvents := make([]components.Event, 0, len(events)) for _, event := range events { convertedEvents = append(convertedEvents, components.Event{ - Time: metav1.Time{Time: time.Unix(event.UnixSeconds, 0)}, + Time: metav1.Time{Time: time.Unix(event.UnixSeconds, 0).UTC()}, Name: EventNameHWSlowdown, Message: strings.Join(event.Reasons, ", "), ExtraInfo: map[string]string{