kubernetes-sigs / scheduler-plugins

Repository for out-of-tree scheduler plugins based on scheduler framework.
Apache License 2.0
1.1k stars 515 forks source link

Add ctx param and error return to EnqueueExtensions.EventsToRegister() #765

Open googs1025 opened 2 months ago

googs1025 commented 2 months ago

What would you like to be added: Because this PR will modify the EnqueueExtensions interface, this issue is created for tracking. After waiting for the new dependency to be updated, this method needs to be modified https://github.com/kubernetes-sigs/scheduler-plugins/blob/master/pkg/capacityscheduling/capacity_scheduling.go#L194 https://github.com/kubernetes-sigs/scheduler-plugins/blob/master/pkg/coscheduling/coscheduling.go#L105 https://github.com/kubernetes-sigs/scheduler-plugins/blob/master/pkg/noderesourcetopology/plugin.go#L123


type EnqueueExtensions interface {
    Plugin
    // EventsToRegister returns a series of possible events that may cause a Pod
    // failed by this plugin schedulable. Each event has a callback function that
    // filters out events to reduce useless retry of Pod's scheduling.
    // The events will be registered when instantiating the internal scheduling queue,
    // and leveraged to build event handlers dynamically.
    // Note: the returned list needs to be static (not depend on configuration parameters);
    // otherwise it would lead to undefined behavior.
    //
    // Appropriate implementation of this function will make Pod's re-scheduling accurate and performant.
    EventsToRegister(context.Context) ([]ClusterEventWithHint, error)
}

Why is this needed:

Huang-Wei commented 2 months ago

Adding milestone v1.31.

ffromani commented 1 month ago

/cc