From 5e02f1b86bdc03bcce06fc9654b6eb1002dc61be Mon Sep 17 00:00:00 2001 From: Xinzhao Xu Date: Mon, 6 Jun 2022 11:31:14 +0800 Subject: [PATCH] Promptly handle the cluster when it is deleted --- pkg/controller/cluster/cluster_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/cluster/cluster_controller.go b/pkg/controller/cluster/cluster_controller.go index c05e04a93..885257b95 100644 --- a/pkg/controller/cluster/cluster_controller.go +++ b/pkg/controller/cluster/cluster_controller.go @@ -184,7 +184,7 @@ func NewClusterController( UpdateFunc: func(oldObj, newObj interface{}) { oldCluster := oldObj.(*clusterv1alpha1.Cluster) newCluster := newObj.(*clusterv1alpha1.Cluster) - if !reflect.DeepEqual(oldCluster.Spec, newCluster.Spec) { + if !reflect.DeepEqual(oldCluster.Spec, newCluster.Spec) || newCluster.DeletionTimestamp != nil { c.enqueueCluster(newObj) } },