mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	Add error handling for Register() call
Register() can return an error as [1], so this adds the error handling.
[1]: f772c9017c/pkg/scheduler/framework/v1alpha1/registry.go (L56)
			
			
This commit is contained in:
		@@ -125,9 +125,12 @@ func TestPreemption(t *testing.T) {
 | 
			
		||||
	// Initialize scheduler with a filter plugin.
 | 
			
		||||
	var filter tokenFilter
 | 
			
		||||
	registry := make(framework.Registry)
 | 
			
		||||
	registry.Register(filterPluginName, func(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
 | 
			
		||||
	err := registry.Register(filterPluginName, func(_ *runtime.Unknown, fh framework.FrameworkHandle) (framework.Plugin, error) {
 | 
			
		||||
		return &filter, nil
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		t.Fatalf("Error registering a filter: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	plugins := &schedulerconfig.Plugins{
 | 
			
		||||
		Filter: &schedulerconfig.PluginSet{
 | 
			
		||||
			Enabled: []schedulerconfig.Plugin{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user