Merge pull request #4939 from iawia002/fix-sync

Promptly handle the cluster when it is deleted
This commit is contained in:
KubeSphere CI Bot
2022-06-08 10:23:43 +08:00
committed by GitHub

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