mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-31 04:04:51 +00:00
Merge 0c8a8fafe7
into 242a4f439f
This commit is contained in:
commit
84419180a5
1 changed files with 23 additions and 1 deletions
|
@ -239,8 +239,30 @@ func getContainerDevicesFromAllocatableResources(availRes *podresourcesapi.Alloc
|
|||
// updateAvailable computes the actually available resources.
|
||||
// This function assumes the available resources are initialized to be equal to the allocatable.
|
||||
func (noderesourceData *nodeResources) updateAvailable(numaData map[int]map[corev1.ResourceName]*resourceData, ri ResourceInfo) {
|
||||
resName := string(ri.Name)
|
||||
resMap, ok := noderesourceData.resourceID2NUMAID[resName]
|
||||
if !ok {
|
||||
resMap = make(map[string]int)
|
||||
for _, numaNodeID := range ri.NumaNodeIds {
|
||||
if _, ok := numaData[numaNodeID]; !ok {
|
||||
klog.InfoS("failed to find NUMA node ID under the node topology", "numaID", numaNodeID)
|
||||
continue
|
||||
}
|
||||
|
||||
if _, ok := numaData[numaNodeID][ri.Name]; !ok {
|
||||
klog.InfoS("failed to find resource under the node topology", "resourceName", ri.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
for _, resID := range ri.Data {
|
||||
resMap[resID] = numaNodeID
|
||||
}
|
||||
}
|
||||
|
||||
noderesourceData.resourceID2NUMAID[resName] = resMap
|
||||
}
|
||||
|
||||
for _, resID := range ri.Data {
|
||||
resName := string(ri.Name)
|
||||
resMap, ok := noderesourceData.resourceID2NUMAID[resName]
|
||||
if !ok {
|
||||
klog.InfoS("unknown resource", "resourceName", ri.Name)
|
||||
|
|
Loading…
Add table
Reference in a new issue