From b47736c50082a1b25d244602774711f8fd0d0295 Mon Sep 17 00:00:00 2001 From: Hanamichi Date: Sun, 14 Aug 2022 22:24:38 +0800 Subject: [PATCH] fix cluster ready condition always true (#5130) Signed-off-by: x893675 Signed-off-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 4b6e3fce2..5504cc3dd 100644 --- a/pkg/controller/cluster/cluster_controller.go +++ b/pkg/controller/cluster/cluster_controller.go @@ -421,6 +421,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 {