mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
scheduler: make algorithm source an option
Changes scheduler.New so that algorithm source is moved from the parameter to an option. The default algorithm source is source with the DefaultProvider.
This commit is contained in:
@@ -181,14 +181,8 @@ func initTestSchedulerWithOptions(
|
||||
legacyscheme.Scheme,
|
||||
v1.DefaultSchedulerName,
|
||||
)
|
||||
var algorithmSrc schedulerapi.SchedulerAlgorithmSource
|
||||
if policy != nil {
|
||||
algorithmSrc = createAlgorithmSourceFromPolicy(policy, context.clientSet)
|
||||
} else {
|
||||
provider := schedulerapi.SchedulerDefaultProviderName
|
||||
algorithmSrc = schedulerapi.SchedulerAlgorithmSource{
|
||||
Provider: &provider,
|
||||
}
|
||||
opts = append(opts, scheduler.WithAlgorithmSource(createAlgorithmSourceFromPolicy(policy, context.clientSet)))
|
||||
}
|
||||
opts = append([]scheduler.Option{scheduler.WithBindTimeoutSeconds(600)}, opts...)
|
||||
context.scheduler, err = scheduler.New(
|
||||
@@ -196,7 +190,6 @@ func initTestSchedulerWithOptions(
|
||||
context.informerFactory,
|
||||
podInformer,
|
||||
recorder,
|
||||
algorithmSrc,
|
||||
context.ctx.Done(),
|
||||
opts...,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user