Skip to content

Commit

Permalink
Merge pull request #2342 from Thor-wl/0708-fix2341
Browse files Browse the repository at this point in the history
filter the rescheduling strategies which contain victim fucntions
  • Loading branch information
volcano-sh-bot committed Jul 8, 2022
2 parents e10dac4 + e358f53 commit 42702f7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/scheduler/plugins/rescheduling/rescheduling.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ func (rp *reschedulingPlugin) OnSessionOpen(ssn *framework.Session) {
return
}

// Get all strategies and register the victim functions
// Get all strategies and register the victim functions for each strategy.
victimFns := make([]api.VictimTasksFn, 0)
for _, strategy := range configs.strategies {
klog.V(4).Infof("strategy: %s\n", strategy.Name)
victimFns = append(victimFns, VictimFn[strategy.Name])
if VictimFn[strategy.Name] != nil {
klog.V(4).Infof("strategy: %s\n", strategy.Name)
victimFns = append(victimFns, VictimFn[strategy.Name])
}
}
ssn.AddVictimTasksFns(rp.Name(), victimFns)
}
Expand Down

0 comments on commit 42702f7

Please sign in to comment.