Fix misleading logs from cluster status controller
Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
This commit is contained in:
parent
e8bc6afb1a
commit
fc5d191ba7
|
@ -137,13 +137,14 @@ func (c *ClusterStatusController) syncClusterStatus(cluster *v1alpha1.Cluster) (
|
||||||
err = wait.PollImmediate(clusterStatusRetryInterval, clusterStatusRetryTimeout, func() (done bool, err error) {
|
err = wait.PollImmediate(clusterStatusRetryInterval, clusterStatusRetryTimeout, func() (done bool, err error) {
|
||||||
online, healthy = getClusterHealthStatus(clusterClient)
|
online, healthy = getClusterHealthStatus(clusterClient)
|
||||||
if !online {
|
if !online {
|
||||||
|
klog.V(2).Infof("Cluster(%s) is offline.", cluster.Name)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
klog.V(2).Infof("Cluster(%s) back to online after retry.", cluster.Name)
|
|
||||||
return true, nil
|
return true, nil
|
||||||
})
|
})
|
||||||
// error indicates that retry timeout, update cluster status immediately and return.
|
// error indicates that retry timeout, update cluster status immediately and return.
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
klog.V(2).Infof("Cluster(%s) still offline after retry, ensuring offline is set.", cluster.Name)
|
||||||
currentClusterStatus.Conditions = generateReadyCondition(false, false)
|
currentClusterStatus.Conditions = generateReadyCondition(false, false)
|
||||||
setTransitionTime(&cluster.Status, ¤tClusterStatus)
|
setTransitionTime(&cluster.Status, ¤tClusterStatus)
|
||||||
return c.updateStatusIfNeeded(cluster, currentClusterStatus)
|
return c.updateStatusIfNeeded(cluster, currentClusterStatus)
|
||||||
|
|
Loading…
Reference in New Issue