Skip to content

Commit

Permalink
perf:add log when federated cluster is not ready
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-lucky committed Aug 7, 2023
1 parent 0800f8a commit 5d42284
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controllers/federatedcluster/clusterstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func checkReadyByHealthz(
if strings.EqualFold(string(body), "ok") {
clusterReadyStatus = corev1.ConditionTrue
} else {
logger.V(3).WithValues("body", body).Info("Cluster is not ready")
clusterReadyStatus = corev1.ConditionFalse
}
return corev1.ConditionFalse, clusterReadyStatus
Expand All @@ -178,8 +179,8 @@ func updateClusterResources(
) error {
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
defer cancel()
if !cache.WaitForCacheSync(ctx.Done(), podsSynced, nodesSynced) {
return fmt.Errorf("timeout waiting for node and pod informer sync")
if !cache.WaitForCacheSync(ctx.Done(), podsSynced, nodesSynced) {
return fmt.Errorf("timeout waiting for node and pod informer sync")
}

nodes, err := nodeLister.List(labels.Everything())
Expand Down

0 comments on commit 5d42284

Please sign in to comment.