clean up the implementation around QueueingHintFn

This commit is contained in:
Kensei Nakada
2023-07-04 15:00:12 +00:00
parent 2f563464bc
commit be0db3f93d
5 changed files with 45 additions and 27 deletions

View File

@@ -366,9 +366,15 @@ var defaultQueueingHintFn = func(_ *v1.Pod, _, _ interface{}) framework.Queueing
}
func buildQueueingHintMap(es []framework.EnqueueExtensions) internalqueue.QueueingHintMap {
queueingHintMap := make(map[framework.ClusterEvent][]*internalqueue.QueueingHintFunction)
queueingHintMap := make(internalqueue.QueueingHintMap)
for _, e := range es {
events := e.EventsToRegister()
// Note: Rarely, a plugin implements EnqueueExtensions but returns nil.
// We treat it as: the plugin is not interested in any event, and hence pod failed by that plugin
// cannot be moved by any regular cluster event.
// So, we can just ignore such EventsToRegister here.
for _, event := range events {
fn := event.QueueingHintFn
if fn == nil {