mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 20:54:08 +00:00
Add compatibility tests for plugin config
This commit is contained in:
@@ -134,6 +134,7 @@ type schedulerOptions struct {
|
||||
frameworkOutOfTreeRegistry framework.Registry
|
||||
profiles []schedulerapi.KubeSchedulerProfile
|
||||
extenders []schedulerapi.Extender
|
||||
frameworkCapturer FrameworkCapturer
|
||||
}
|
||||
|
||||
// Option configures a Scheduler
|
||||
@@ -204,6 +205,16 @@ func WithExtenders(e ...schedulerapi.Extender) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// FrameworkCapturer is used for registering a notify function in building framework.
|
||||
type FrameworkCapturer func(schedulerapi.KubeSchedulerProfile)
|
||||
|
||||
// WithBuildFrameworkCapturer sets a notify function for getting buildFramework details.
|
||||
func WithBuildFrameworkCapturer(fc FrameworkCapturer) Option {
|
||||
return func(o *schedulerOptions) {
|
||||
o.frameworkCapturer = fc
|
||||
}
|
||||
}
|
||||
|
||||
var defaultSchedulerOptions = schedulerOptions{
|
||||
profiles: []schedulerapi.KubeSchedulerProfile{
|
||||
// Profiles' default plugins are set from the algorithm provider.
|
||||
@@ -273,6 +284,7 @@ func New(client clientset.Interface,
|
||||
registry: registry,
|
||||
nodeInfoSnapshot: snapshot,
|
||||
extenders: options.extenders,
|
||||
frameworkCapturer: options.frameworkCapturer,
|
||||
}
|
||||
|
||||
metrics.Register()
|
||||
|
Reference in New Issue
Block a user