skip descheduling ResourceBinding which is being deleted

Signed-off-by: whitewindmills <jayfantasyhjh@gmail.com>
This commit is contained in:
whitewindmills 2024-08-28 17:05:03 +08:00
parent 295dee80dc
commit e13d06b70d
1 changed files with 4 additions and 0 deletions

View File

@ -186,6 +186,10 @@ func (d *Descheduler) worker(key util.QueueKey) error {
}
return fmt.Errorf("get ResourceBinding(%s) error: %v", namespacedName, err)
}
if !binding.DeletionTimestamp.IsZero() {
klog.Infof("ResourceBinding(%s) in work queue is being deleted, ignore.", namespacedName)
return nil
}
h := core.NewSchedulingResultHelper(binding)
if _, undesiredClusters := h.GetUndesiredClusters(); len(undesiredClusters) == 0 {