Migrated pkg/scheduler/framework/plugins/examples/ to use contextual logging

This commit is contained in:
Mengjiao Liu 2023-03-23 15:14:14 +08:00
parent ef838ca27c
commit 9cca527c4b
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.
func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
func New(_ context.Context, _ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
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.
func New(_ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
func New(_ context.Context, _ *runtime.Unknown, _ framework.Handle) (framework.Plugin, error) {
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.
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 {
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")
}
mp := MultipointExample{}