Skip to content

Commit 2116b0f

Browse files
Merge pull request #29942 from Prashanth684/okd-cs10-fix
OKD-267: Support RFC339 based timestamp layout for reboot tests
2 parents 2525941 + 8422730 commit 2116b0f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/extended/machines/cluster.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,22 @@ func parseRebootInstances(rebootsOutput string) ([]bootTimelineEntry, error) {
284284
continue
285285
}
286286
date := fields[0]
287-
bootTime, err := time.Parse("2006-01-02T15:04:05-0700", date)
287+
288+
var bootTime time.Time
289+
var err error
290+
291+
layouts := []string{
292+
"2006-01-02T15:04:05-0700",
293+
"2006-01-02T15:04:05-07:00", // for cs10, rhel10
294+
}
295+
296+
for _, layout := range layouts {
297+
bootTime, err = time.Parse(layout, date)
298+
if err == nil {
299+
break
300+
}
301+
}
302+
288303
if err != nil {
289304
return nil, err
290305
}

0 commit comments

Comments
 (0)