Merge pull request #98296 from Huang-Wei/avoid-singleton

sched: avoid using shareable singleton instance
This commit is contained in:
Kubernetes Prow Robot 2021-01-22 07:33:27 -08:00 committed by GitHub
commit 64baf0f73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}