mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
Remove FIFO dependency from SchedulerLoop
This commit is contained in:
parent
ae4673e86e
commit
f793ddffbb
@ -68,9 +68,18 @@ func NewScheduler(c *config.Config, fw types.Framework, client *client.Client, r
|
|||||||
// an ordering (vs interleaving) of operations that's easier to reason about.
|
// an ordering (vs interleaving) of operations that's easier to reason about.
|
||||||
|
|
||||||
q := queuer.New(podUpdates)
|
q := queuer.New(podUpdates)
|
||||||
|
|
||||||
|
algorithm := NewSchedulerAlgorithm(fw, podUpdates)
|
||||||
|
|
||||||
podDeleter := NewDeleter(fw, q)
|
podDeleter := NewDeleter(fw, q)
|
||||||
|
|
||||||
podReconciler := NewPodReconciler(fw, client, q, podDeleter)
|
podReconciler := NewPodReconciler(fw, client, q, podDeleter)
|
||||||
|
|
||||||
|
bo := backoff.New(c.InitialPodBackoff.Duration, c.MaxPodBackoff.Duration)
|
||||||
|
errorHandler := NewErrorHandler(fw, bo, q)
|
||||||
|
|
||||||
|
binder := NewBinder(fw)
|
||||||
|
|
||||||
startLatch := make(chan struct{})
|
startLatch := make(chan struct{})
|
||||||
eventBroadcaster := record.NewBroadcaster()
|
eventBroadcaster := record.NewBroadcaster()
|
||||||
|
|
||||||
@ -84,18 +93,17 @@ func NewScheduler(c *config.Config, fw types.Framework, client *client.Client, r
|
|||||||
podtask.InstallDebugHandlers(fw.Tasks(), mux)
|
podtask.InstallDebugHandlers(fw.Tasks(), mux)
|
||||||
})
|
})
|
||||||
|
|
||||||
return NewSchedulerLoop(c, fw, client, recorder, podUpdates, q, startLatch), podReconciler
|
return NewSchedulerLoop(client, algorithm, recorder, q.Yield, errorHandler.Error, binder, startLatch), podReconciler
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSchedulerLoop(c *config.Config, fw types.Framework, client *client.Client,
|
func NewSchedulerLoop(client *client.Client, algorithm *SchedulerAlgorithm,
|
||||||
recorder record.EventRecorder, podUpdates queue.FIFO, q *queuer.Queuer,
|
recorder record.EventRecorder, nextPod func() *api.Pod, error func(pod *api.Pod, schedulingErr error),
|
||||||
started chan<- struct{}) *SchedulerLoop {
|
binder *Binder, started chan<- struct{}) *SchedulerLoop {
|
||||||
bo := backoff.New(c.InitialPodBackoff.Duration, c.MaxPodBackoff.Duration)
|
|
||||||
return &SchedulerLoop{
|
return &SchedulerLoop{
|
||||||
algorithm: NewSchedulerAlgorithm(fw, podUpdates),
|
algorithm: algorithm,
|
||||||
binder: NewBinder(fw),
|
binder: binder,
|
||||||
nextPod: q.Yield,
|
nextPod: nextPod,
|
||||||
error: NewErrorHandler(fw, bo, q).Error,
|
error: error,
|
||||||
recorder: recorder,
|
recorder: recorder,
|
||||||
client: client,
|
client: client,
|
||||||
started: started,
|
started: started,
|
||||||
|
Loading…
Reference in New Issue
Block a user