mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-30 19:54:46 +00:00
source/memory: fix memory.numa label
This commit is contained in:
parent
c4af8a1229
commit
17b094d8d6
1 changed files with 5 additions and 2 deletions
|
@ -60,7 +60,7 @@ func (s *memorySource) GetLabels() (source.FeatureLabels, error) {
|
||||||
features := s.GetFeatures()
|
features := s.GetFeatures()
|
||||||
|
|
||||||
// NUMA
|
// NUMA
|
||||||
if len(features.Values[NumaFeature].Elements) > 0 {
|
if isNuma, ok := features.Values[NumaFeature].Elements["is_numa"]; ok && isNuma == "true" {
|
||||||
labels["numa"] = 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 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
|
// detectNv detects NVDIMM devices
|
||||||
|
|
Loading…
Add table
Reference in a new issue