mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	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:
		| @@ -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{} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Prow Robot
					Kubernetes Prow Robot