Merge pull request #116885 from mengjiao-liu/contextual-logging-scheduler-plugin-examples

Migrated  `pkg/scheduler/framework/plugins/examples/` to use contextual logging
This commit is contained in:
Kubernetes Prow Robot 2023-10-09 20:32:46 +02:00 committed by GitHub
commit e224fc75ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -86,6 +86,6 @@ func (mc CommunicatingPlugin) PreBind(ctx context.Context, state *framework.Cycl
} }
// New initializes a new plugin and returns it. // New initializes a new plugin and returns it.
func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) { func New(_ context.Context, _ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
return &CommunicatingPlugin{}, nil return &CommunicatingPlugin{}, nil
} }

View File

@ -49,6 +49,6 @@ func (sr StatelessPreBindExample) PreBind(ctx context.Context, state *framework.
} }
// New initializes a new plugin and returns it. // New initializes a new plugin and returns it.
func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) { func New(_ context.Context, _ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
return &StatelessPreBindExample{}, nil return &StatelessPreBindExample{}, nil
} }

View File

@ -82,9 +82,9 @@ func (mp *MultipointExample) PreBind(ctx context.Context, state *framework.Cycle
} }
// New initializes a new plugin and returns it. // New initializes a new plugin and returns it.
func New(config *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) { func New(ctx context.Context, config *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
if config == nil { if config == nil {
klog.ErrorS(nil, "MultipointExample configuration cannot be empty") klog.FromContext(ctx).Error(nil, "MultipointExample configuration cannot be empty")
return nil, fmt.Errorf("MultipointExample configuration cannot be empty") return nil, fmt.Errorf("MultipointExample configuration cannot be empty")
} }
mp := MultipointExample{} mp := MultipointExample{}