Skip to content

Commit

Permalink
Add check for nil timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronH88 committed Oct 23, 2024
1 parent ba214b9 commit d47c57e
Showing 1 changed file with 5 additions and 3 deletions.
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 @@ func (kw *KubeUnit) kubeLoggingWithReconnect(streamWait *sync.WaitGroup, stdout

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 @@ func (kw *KubeUnit) kubeLoggingWithReconnect(streamWait *sync.WaitGroup, stdout
return
}
remainingRetries = retries // each time we read successfully, reset this counter
sinceTime = *timeStamp
successfulWrite = true
}

Expand Down

0 comments on commit d47c57e

Please sign in to comment.