Skip to content

Commit 97ff5f6

Browse files
Avoid reporting health check error when the cache is stopped
1 parent daba8fe commit 97ff5f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

controllers/remote/cluster_cache.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ func (t *ClusterCacheTracker) healthCheckCluster(ctx context.Context, in *health
346346
err := wait.PollImmediateUntil(in.interval, runHealthCheckWithThreshold, ctx.Done())
347347
// An error returned implies the health check has failed a sufficient number of
348348
// times for the cluster to be considered unhealthy
349-
if err != nil {
349+
// NB. we are ignoring ErrWaitTimeout because this error happens when the channel is close, that in this case
350+
// happens when the cache is explicitly stopped.
351+
if err != nil && err != wait.ErrWaitTimeout {
350352
t.log.Error(err, "Error health checking cluster", "cluster", in.cluster.String())
351353
t.deleteAccessor(in.cluster)
352354
}

0 commit comments

Comments
 (0)