1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-14 20:56:42 +00:00

topologyupdater: Prevent crash with incorrect node id

It's possible for device plugins to advertise non-existent
numa node ids that cause topology updater to crash.

Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
This commit is contained in:
Tuomas Katila 2022-03-15 11:13:04 +02:00
parent 19a57789ad
commit 2ceafe83b7

View file

@ -246,6 +246,11 @@ func (noderesourceData *nodeResources) updateAvailable(numaData map[int]map[v1.R
klog.Infof("unknown resource %q: %q", resName, resID)
continue
}
if _, ok := numaData[nodeID]; !ok {
klog.Infof("unknown node id: %q", nodeID)
continue
}
numaData[nodeID][ri.Name].available--
}
}