sched: avoid using shareable singleton instance

This commit is contained in:
Wei Huang 2021-01-21 22:40:06 -08:00
parent 73fbd3da09
commit 2ba120dcfa
No known key found for this signature in database
GPG Key ID: BE5E9752F8B6E005

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