1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 02:37:11 +00:00

Merge pull request #666 from marquiz/fixes/memory

source/memory: fix memory.numa label
This commit is contained in:
Kubernetes Prow Robot 2021-11-24 06:34:20 -08:00 committed by GitHub
commit b46a95f7ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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