mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
Extend plugin's New with a context.Context
The new context.Context can be later used for passing a contextualized logger. Or, other initialization steps that require the context.
This commit is contained in:
@@ -44,7 +44,7 @@ type RemovePodsViolatingNodeTaints struct {
|
||||
var _ frameworktypes.DeschedulePlugin = &RemovePodsViolatingNodeTaints{}
|
||||
|
||||
// New builds plugin from its arguments while passing a handle
|
||||
func New(args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plugin, error) {
|
||||
func New(ctx context.Context, args runtime.Object, handle frameworktypes.Handle) (frameworktypes.Plugin, error) {
|
||||
nodeTaintsArgs, ok := args.(*RemovePodsViolatingNodeTaintsArgs)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("want args to be of type RemovePodsViolatingNodeTaintsArgs, got %T", args)
|
||||
|
||||
Reference in New Issue
Block a user