Change the scheduler plugins PluginFactory function to use context parameter to pass logger
- Migrated pkg/scheduler/framework/plugins/nodevolumelimits to use contextual logging - Fix golangci-lint validation failed - Check for plugins creation err
This commit is contained in:
@@ -63,7 +63,7 @@ func (pl *DefaultPreemption) Name() string {
|
||||
}
|
||||
|
||||
// New initializes a new plugin and returns it.
|
||||
func New(dpArgs runtime.Object, fh framework.Handle, fts feature.Features) (framework.Plugin, error) {
|
||||
func New(_ context.Context, dpArgs runtime.Object, fh framework.Handle, fts feature.Features) (framework.Plugin, error) {
|
||||
args, ok := dpArgs.(*config.DefaultPreemptionArgs)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("got args of type %T, want *DefaultPreemptionArgs", dpArgs)
|
||||
|
@@ -104,7 +104,7 @@ type TestPlugin struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func newTestPlugin(injArgs runtime.Object, f framework.Handle) (framework.Plugin, error) {
|
||||
func newTestPlugin(_ context.Context, injArgs runtime.Object, f framework.Handle) (framework.Plugin, error) {
|
||||
return &TestPlugin{name: "test-plugin"}, nil
|
||||
}
|
||||
|
||||
@@ -1066,7 +1066,7 @@ func TestDryRunPreemption(t *testing.T) {
|
||||
registeredPlugins := append([]tf.RegisterPluginFunc{
|
||||
tf.RegisterFilterPlugin(
|
||||
"FakeFilter",
|
||||
func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
|
||||
func(_ context.Context, _ runtime.Object, fh framework.Handle) (framework.Plugin, error) {
|
||||
return &fakePlugin, nil
|
||||
},
|
||||
)},
|
||||
|
Reference in New Issue
Block a user