Skip to content

Commit

Permalink
Skip schedule deleting bindings
Browse files Browse the repository at this point in the history
Signed-off-by: whitewindmills <[email protected]>
  • Loading branch information
whitewindmills committed May 24, 2024
1 parent 2220124 commit b43e931
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b43e931

Please sign in to comment.