From fc5d191ba799b32ecb02407c380c8b3fbb08a3ef Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Mon, 16 Aug 2021 12:09:35 +0800 Subject: [PATCH] Fix misleading logs from cluster status controller Signed-off-by: RainbowMango --- pkg/controllers/status/cluster_status_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/status/cluster_status_controller.go b/pkg/controllers/status/cluster_status_controller.go index 2435842d4..fcf4fb997 100644 --- a/pkg/controllers/status/cluster_status_controller.go +++ b/pkg/controllers/status/cluster_status_controller.go @@ -137,13 +137,14 @@ func (c *ClusterStatusController) syncClusterStatus(cluster *v1alpha1.Cluster) ( err = wait.PollImmediate(clusterStatusRetryInterval, clusterStatusRetryTimeout, func() (done bool, err error) { online, healthy = getClusterHealthStatus(clusterClient) if !online { + klog.V(2).Infof("Cluster(%s) is offline.", cluster.Name) return false, nil } - klog.V(2).Infof("Cluster(%s) back to online after retry.", cluster.Name) return true, nil }) // error indicates that retry timeout, update cluster status immediately and return. if err != nil { + klog.V(2).Infof("Cluster(%s) still offline after retry, ensuring offline is set.", cluster.Name) currentClusterStatus.Conditions = generateReadyCondition(false, false) setTransitionTime(&cluster.Status, ¤tClusterStatus) return c.updateStatusIfNeeded(cluster, currentClusterStatus)