1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

source/memory: fix memory.numa label

This commit is contained in:
Markus Lehtonen 2021-11-23 20:33:50 +02:00
parent c4af8a1229
commit 17b094d8d6

View file

@ -60,7 +60,7 @@ func (s *memorySource) GetLabels() (source.FeatureLabels, error) {
features := s.GetFeatures()
// NUMA
if len(features.Values[NumaFeature].Elements) > 0 {
if isNuma, ok := features.Values[NumaFeature].Elements["is_numa"]; ok && isNuma == "true" {
labels["numa"] = true
}
@ -118,7 +118,10 @@ func detectNuma() (map[string]string, error) {
return nil, fmt.Errorf("failed to list numa nodes: %w", err)
}
return map[string]string{"node_count": strconv.Itoa(len(nodes))}, nil
return map[string]string{
"is_numa": strconv.FormatBool(len(nodes) > 1),
"node_count": strconv.Itoa(len(nodes)),
}, nil
}
// detectNv detects NVDIMM devices