Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for nil timestamp #1187

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkg/workceptor/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,11 @@

split := strings.SplitN(line, " ", 2)
timeStamp := ParseTime(split[0])
if !timeStamp.After(sinceTime) && !successfulWrite {
continue
if timeStamp != nil {
if !timeStamp.After(sinceTime) && !successfulWrite {
continue

Check warning on line 391 in pkg/workceptor/kubernetes.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/kubernetes.go#L389-L391

Added lines #L389 - L391 were not covered by tests
}
sinceTime = *timeStamp

Check warning on line 393 in pkg/workceptor/kubernetes.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/kubernetes.go#L393

Added line #L393 was not covered by tests
}
msg := split[1]

Expand All @@ -399,7 +402,6 @@
return
}
remainingRetries = retries // each time we read successfully, reset this counter
sinceTime = *timeStamp
successfulWrite = true
}

Expand Down