Skip to content

Commit 52f2b8e

Browse files
committed
error and return instead
1 parent 0d6d910 commit 52f2b8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/kubernetes/event/watcher.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ func (w *Watcher) watch(ctx context.Context, env string, client kubernetes.Inter
204204
}
205205
case event, ok := <-rescale.ResultChan():
206206
if !ok {
207-
continue
207+
w.log.WithField("env", env).WithField("watcher", "rescale").Error("watching events returned closed channel")
208+
return fmt.Errorf("watcher failed")
208209
}
209210
w.eventsCounter.Add(ctx, 1, metric.WithAttributes(
210211
attribute.String("environment", string(env)),
@@ -242,7 +243,8 @@ func (w *Watcher) watch(ctx context.Context, env string, client kubernetes.Inter
242243
})
243244
case event, ok := <-killing.ResultChan():
244245
if !ok {
245-
continue
246+
w.log.WithField("env", env).WithField("watcher", "rescale").Error("watching events returned closed channel")
247+
return fmt.Errorf("watcher failed")
246248
}
247249

248250
w.eventsCounter.Add(ctx, 1, metric.WithAttributes(

0 commit comments

Comments
 (0)