mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	implement EnqueueExtensions interface in noderesources
This commit is contained in:
		@@ -35,6 +35,7 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
var _ framework.PreFilterPlugin = &Fit{}
 | 
					var _ framework.PreFilterPlugin = &Fit{}
 | 
				
			||||||
var _ framework.FilterPlugin = &Fit{}
 | 
					var _ framework.FilterPlugin = &Fit{}
 | 
				
			||||||
 | 
					var _ framework.EnqueueExtensions = &Fit{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	// FitName is the name of the plugin used in the plugin registry and configurations.
 | 
						// FitName is the name of the plugin used in the plugin registry and configurations.
 | 
				
			||||||
@@ -189,6 +190,18 @@ func getPreFilterState(cycleState *framework.CycleState) (*preFilterState, error
 | 
				
			|||||||
	return s, nil
 | 
						return s, nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// EventsToRegister returns the possible events that may make a Pod
 | 
				
			||||||
 | 
					// failed by this plugin schedulable.
 | 
				
			||||||
 | 
					// NOTE: if in-place-update (KEP 1287) gets implemented, then PodUpdate event
 | 
				
			||||||
 | 
					// should be registered for this plugin since a Pod update may free up resources
 | 
				
			||||||
 | 
					// that make other Pods schedulable.
 | 
				
			||||||
 | 
					func (f *Fit) EventsToRegister() []framework.ClusterEvent {
 | 
				
			||||||
 | 
						return []framework.ClusterEvent{
 | 
				
			||||||
 | 
							{Resource: framework.Pod, ActionType: framework.Delete},
 | 
				
			||||||
 | 
							{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeAllocatable},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Filter invoked at the filter extension point.
 | 
					// Filter invoked at the filter extension point.
 | 
				
			||||||
// Checks if a node has sufficient resources, such as cpu, memory, gpu, opaque int resources etc to run a pod.
 | 
					// Checks if a node has sufficient resources, such as cpu, memory, gpu, opaque int resources etc to run a pod.
 | 
				
			||||||
// It returns a list of insufficient resources, if empty, then the node has all the resources requested by the pod.
 | 
					// It returns a list of insufficient resources, if empty, then the node has all the resources requested by the pod.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user