Skip to content

Commit

Permalink
feat(nvidia): set components/events timestamp in UTC explicitly (#227)
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho authored Dec 3, 2024
1 parent b6cb437 commit e46a8f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/accelerator/nvidia/error-xid-sxid/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion components/accelerator/nvidia/hw-slowdown/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit e46a8f0

Please sign in to comment.