Skip to content

Commit 5a9cba6

Browse files
committed
Console Event IDs: Use UTC timestamps
The `NewConsoleEventID` function is supposed to return a deterministic string in relation to a given console. The `time.Time` object contains data about the local timezone, and `time.Format()` uses this, therefore stamping out a timestamp string which matches local time. We never want to do this; the string returned from this function should be the same across all environments, regardless of what the local timezone is set to, therefore we need to convert to UTC before formatting.
1 parent 42854e9 commit 5a9cba6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.1
1+
3.8.2

pkg/workloads/console/events/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type ConsoleTerminatedEvent struct {
9797
func NewConsoleEventID(context, namespace, console string, time time.Time) string {
9898
return strings.Join([]string{
9999
// year (2006) month (01) day (02) hour (15) minute (04) second (05)
100-
time.Format("20060102150405"),
100+
time.UTC().Format("20060102150405"),
101101
context, namespace, console,
102102
}, "/")
103103
}

0 commit comments

Comments
 (0)