From d0d8c66b3b0f6c493459522bd5b95f82ab057102 Mon Sep 17 00:00:00 2001 From: Chaer <49875152+Eikykun@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:21:25 +0800 Subject: [PATCH] fix: ptr lost events case (#307) fix ptr lost events case --- pkg/controllers/podtransitionrule/eventhandler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/podtransitionrule/eventhandler.go b/pkg/controllers/podtransitionrule/eventhandler.go index 7fa4edbb..4b41abf3 100644 --- a/pkg/controllers/podtransitionrule/eventhandler.go +++ b/pkg/controllers/podtransitionrule/eventhandler.go @@ -31,6 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/runtime/inject" appsv1alpha1 "kusionstack.io/kube-api/apps/v1alpha1" + processorrules "kusionstack.io/kuperator/pkg/controllers/podtransitionrule/processor/rules" commonutils "kusionstack.io/kuperator/pkg/utils" ) @@ -145,7 +146,9 @@ func (p *PodTransitionRuleEventHandler) Create(e event.CreateEvent, q workqueue. func (p *PodTransitionRuleEventHandler) Update(e event.UpdateEvent, q workqueue.RateLimitingInterface) { oldPodTransitionRule := e.ObjectOld.(*appsv1alpha1.PodTransitionRule) newPodTransitionRule := e.ObjectNew.(*appsv1alpha1.PodTransitionRule) - if equality.Semantic.DeepEqual(oldPodTransitionRule.Spec, newPodTransitionRule.Spec) && newPodTransitionRule.DeletionTimestamp == nil { + if equality.Semantic.DeepEqual(oldPodTransitionRule.Spec, newPodTransitionRule.Spec) && + equality.Semantic.DeepEqual(oldPodTransitionRule.Status, newPodTransitionRule.Status) && + newPodTransitionRule.DeletionTimestamp == nil { return } q.Add(reconcile.Request{NamespacedName: types.NamespacedName{