From b43e93136aa2da775c7341bcd9090c295e3d9e9b Mon Sep 17 00:00:00 2001 From: whitewindmills Date: Fri, 24 May 2024 16:16:20 +0800 Subject: [PATCH] Skip schedule deleting bindings Signed-off-by: whitewindmills --- pkg/scheduler/scheduler.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index b03dbf7cf607..2f4e7737d895 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -334,6 +334,12 @@ func (s *Scheduler) doScheduleBinding(namespace, name string) (err error) { } return err } + if !rb.DeletionTimestamp.IsZero() { + s.recordScheduleResultEventForResourceBinding(rb, nil, fmt.Errorf("skip schedule deleting resourceBinding: %s/%s", rb.Namespace, rb.Name)) + klog.V(4).InfoS("Skip schedule deleting ResourceBinding", "ResourceBinding", klog.KObj(rb)) + return nil + } + rb = rb.DeepCopy() if rb.Spec.Placement == nil { @@ -398,6 +404,12 @@ func (s *Scheduler) doScheduleClusterBinding(name string) (err error) { } return err } + if !crb.DeletionTimestamp.IsZero() { + s.recordScheduleResultEventForClusterResourceBinding(crb, nil, fmt.Errorf("skip schedule deleting clusterResourceBinding: %s", crb.Name)) + klog.V(4).InfoS("Skip schedule deleting ClusterResourceBinding", "ClusterResourceBinding", klog.KObj(crb)) + return nil + } + crb = crb.DeepCopy() if crb.Spec.Placement == nil {