mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #98296 from Huang-Wei/avoid-singleton
sched: avoid using shareable singleton instance
This commit is contained in:
commit
64baf0f73f
@ -212,8 +212,10 @@ func WithCaptureProfile(c CaptureProfile) Option {
|
||||
}
|
||||
}
|
||||
|
||||
var defaultFrameworkOptions = frameworkOptions{
|
||||
metricsRecorder: newMetricsRecorder(1000, time.Second),
|
||||
func defaultFrameworkOptions() frameworkOptions {
|
||||
return frameworkOptions{
|
||||
metricsRecorder: newMetricsRecorder(1000, time.Second),
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(#91029): move this to frameworkImpl runtime package.
|
||||
@ -234,7 +236,7 @@ var _ framework.Framework = &frameworkImpl{}
|
||||
|
||||
// NewFramework initializes plugins given the configuration and the registry.
|
||||
func NewFramework(r Registry, plugins *config.Plugins, args []config.PluginConfig, opts ...Option) (framework.Framework, error) {
|
||||
options := defaultFrameworkOptions
|
||||
options := defaultFrameworkOptions()
|
||||
for _, opt := range opts {
|
||||
opt(&options)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user