Skip to content

Commit

Permalink
add error log print for health check cluster failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi080513 committed Jul 21, 2023
1 parent 7c0eab1 commit 2f1d311
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/remote/cluster_cache_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ func (t *ClusterCacheTracker) healthCheckCluster(ctx context.Context, in *health

if unhealthyCount >= in.unhealthyThreshold {
// Cluster is now considered unhealthy.
fmt.Println(err.Error())
fmt.Println(errors.Is(err, context.DeadlineExceeded))
return false, err
}

Expand All @@ -651,6 +653,8 @@ func (t *ClusterCacheTracker) healthCheckCluster(ctx context.Context, in *health
// times for the cluster to be considered unhealthy
// NB. we are ignoring ErrWaitTimeout because this error happens when the channel is close, that in this case
// happens when the cache is explicitly stopped.
fmt.Println(err.Error())
fmt.Println(errors.Is(err, context.DeadlineExceeded))
if err != nil && !wait.Interrupted(err) {
t.log.Error(err, "Error health checking cluster", "Cluster", klog.KRef(in.cluster.Namespace, in.cluster.Name))
t.deleteAccessor(ctx, in.cluster)
Expand Down

0 comments on commit 2f1d311

Please sign in to comment.