Skip to content

Commit

Permalink
Add check for nil timestamp (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronH88 authored Oct 23, 2024
1 parent ba214b9 commit 32a3ae7
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
}
sinceTime = *timeStamp
}
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 32a3ae7

Please sign in to comment.