Skip to content

Commit

Permalink
fix: ptr lost events case (#307)
Browse files Browse the repository at this point in the history
fix ptr lost events case
  • Loading branch information
Eikykun authored Nov 22, 2024
1 parent 281e071 commit d0d8c66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controllers/podtransitionrule/eventhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit d0d8c66

Please sign in to comment.