@@ -180,6 +180,11 @@ func singleNUMAPodLevelHandler(lh logr.Logger, pod *v1.Pod, zones topologyv1alph
180180 return nil
181181}
182182
183+ func rejectNonSingleNUMANodeHandler (lh logr.Logger , _ * v1.Pod , _ topologyv1alpha2.ZoneList , nodeInfo * framework.NodeInfo ) * framework.Status {
184+ lh .Info ("Rejecting node because it is not configured with Single NUMA Node policy" , "node" , klog .KObj (nodeInfo .Node ()))
185+ return framework .NewStatus (framework .Unschedulable , "Node does not have Single NUMA Node policy" )
186+ }
187+
183188// Filter Now only single-numa-node supported
184189func (tm * TopologyMatch ) Filter (ctx context.Context , cycleState * framework.CycleState , pod * v1.Pod , nodeInfo * framework.NodeInfo ) * framework.Status {
185190 if nodeInfo .Node () == nil {
@@ -223,14 +228,17 @@ func (tm *TopologyMatch) Filter(ctx context.Context, cycleState *framework.Cycle
223228}
224229
225230func filterHandlerFromTopologyManager (conf nodeconfig.TopologyManager ) filterFn {
226- if conf .Policy != kubeletconfig .SingleNumaNodeTopologyManagerPolicy {
227- return nil
231+ if conf .Policy != kubeletconfig .SingleNumaNodeTopologyManagerPolicy &&
232+ conf .Policy != kubeletconfig .BestEffortTopologyManagerPolicy &&
233+ conf .Policy != kubeletconfig .RestrictedTopologyManagerPolicy {
234+ return rejectNonSingleNUMANodeHandler
228235 }
229- if conf .Scope == kubeletconfig .PodTopologyManagerScope {
236+ switch conf .Scope {
237+ case kubeletconfig .PodTopologyManagerScope :
230238 return singleNUMAPodLevelHandler
231- }
232- if conf .Scope == kubeletconfig .ContainerTopologyManagerScope {
239+ case kubeletconfig .ContainerTopologyManagerScope :
233240 return singleNUMAContainerLevelHandler
241+ default :
242+ return nil
234243 }
235- return nil // cannot happen
236244}
0 commit comments