mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Migrated pkg/scheduler/framework/plugins/examples/
to use contextual logging
This commit is contained in:
parent
ef838ca27c
commit
9cca527c4b
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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{}
|
||||||
|
Loading…
Reference in New Issue
Block a user