@@ -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 {
@@ -224,13 +229,14 @@ func (tm *TopologyMatch) Filter(ctx context.Context, cycleState *framework.Cycle
224229
225230func filterHandlerFromTopologyManager (conf nodeconfig.TopologyManager ) filterFn {
226231 if conf .Policy != kubeletconfig .SingleNumaNodeTopologyManagerPolicy {
227- return nil
232+ return rejectNonSingleNUMANodeHandler
228233 }
229- if conf .Scope == kubeletconfig .PodTopologyManagerScope {
234+ switch conf .Scope {
235+ case kubeletconfig .PodTopologyManagerScope :
230236 return singleNUMAPodLevelHandler
231- }
232- if conf .Scope == kubeletconfig .ContainerTopologyManagerScope {
237+ case kubeletconfig .ContainerTopologyManagerScope :
233238 return singleNUMAContainerLevelHandler
239+ default :
240+ return nil
234241 }
235- return nil // cannot happen
236242}
0 commit comments