Promptly handle the cluster when it is deleted

This commit is contained in:
Xinzhao Xu
2022-06-06 11:31:14 +08:00
parent 0c2a419a5e
commit 5e02f1b86b

View File

@@ -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)
}
},