in pkg/noderesourcetopology/filter.go [184:222]
func (tm *TopologyMatch) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
if nodeInfo.Node() == nil {
return framework.NewStatus(framework.Error, "node not found")
}
if v1qos.GetPodQOS(pod) == v1.PodQOSBestEffort && !resourcerequests.IncludeNonNative(pod) {
return nil
}
nodeName := nodeInfo.Node().Name
lh := klog.FromContext(ctx).WithValues(logging.KeyPod, klog.KObj(pod), logging.KeyPodUID, logging.PodUID(pod), logging.KeyNode, nodeName)
lh.V(4).Info(logging.FlowBegin)
defer lh.V(4).Info(logging.FlowEnd)
nodeTopology, info := tm.nrtCache.GetCachedNRTCopy(ctx, nodeName, pod)
lh = lh.WithValues(logging.KeyGeneration, info.Generation)
if !info.Fresh {
lh.V(2).Info("invalid topology data")
return framework.NewStatus(framework.Unschedulable, "invalid node topology data")
}
if nodeTopology == nil {
return nil
}
conf := nodeconfig.TopologyManagerFromNodeResourceTopology(lh, nodeTopology)
lh.V(4).Info("found nrt data", "object", stringify.NodeResourceTopologyResources(nodeTopology), "conf", conf.String())
handler := filterHandlerFromTopologyManager(conf)
if handler == nil {
return nil
}
status := handler(lh, pod, nodeTopology.Zones, nodeInfo)
if status != nil {
tm.nrtCache.NodeMaybeOverReserved(nodeName, pod)
}
return status
}