Skip to content

Commit

Permalink
Merge pull request #1933 from smira/fix/endless-loop
Browse files Browse the repository at this point in the history
fix: break the watch loop when the watch fails
  • Loading branch information
franknstyle authored Oct 18, 2023
2 parents e0a409a + e20e6bb commit e5bb561
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/client/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ func watchPodsToStreamLogs(client kubernetes.Interface, cfg *LogConfig, podCh ch

go func() {
for {
v := <-ch
v, ok := <-ch
if !ok {
break
}

if v.Type == watch.Added && v.Object != nil {
switch t := v.Object.(type) {
case *v1.Pod:
Expand Down

0 comments on commit e5bb561

Please sign in to comment.