From 54df6b8c8c63a74b22e4ae642262ebd3cdf3dc27 Mon Sep 17 00:00:00 2001 From: KubeSphere CI Bot <47586280+ks-ci-bot@users.noreply.github.com> Date: Tue, 16 Aug 2022 14:12:46 +0800 Subject: [PATCH] [release-3.3] fix cluster ready condition always true (#5137) fix cluster ready condition always true Signed-off-by: x893675 Signed-off-by: x893675 Co-authored-by: x893675 --- pkg/controller/cluster/cluster_controller.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/controller/cluster/cluster_controller.go b/pkg/controller/cluster/cluster_controller.go index 9ec26306c..7d7812c4c 100644 --- a/pkg/controller/cluster/cluster_controller.go +++ b/pkg/controller/cluster/cluster_controller.go @@ -418,6 +418,15 @@ func (c *clusterController) syncCluster(key string) error { Message: "Cluster can not join federation control plane", } c.updateClusterCondition(cluster, federationNotReadyCondition) + notReadyCondition := clusterv1alpha1.ClusterCondition{ + Type: clusterv1alpha1.ClusterReady, + Status: v1.ConditionFalse, + LastUpdateTime: metav1.Now(), + LastTransitionTime: metav1.Now(), + Reason: "Cluster join federation control plane failed", + Message: "Cluster is Not Ready now", + } + c.updateClusterCondition(cluster, notReadyCondition) _, err = c.ksClient.ClusterV1alpha1().Clusters().Update(context.TODO(), cluster, metav1.UpdateOptions{}) if err != nil {