mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
Merge pull request #366 from uniemimu/master
topology: avoid unnecessary warning prints
This commit is contained in:
commit
0a7b6a7ea0
@ -270,6 +270,7 @@ func GetTopologyInfo(devs []string) (*pluginapi.TopologyInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, hint := range hints {
|
for _, hint := range hints {
|
||||||
|
if hint.NUMAs != "" {
|
||||||
for _, nNode := range strings.Split(hint.NUMAs, ",") {
|
for _, nNode := range strings.Split(hint.NUMAs, ",") {
|
||||||
nNodeID, err := strconv.ParseInt(strings.TrimSpace(nNode), 10, 64)
|
nNodeID, err := strconv.ParseInt(strings.TrimSpace(nNode), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -285,6 +286,7 @@ func GetTopologyInfo(devs []string) (*pluginapi.TopologyInfo, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sort.Slice(result.Nodes, func(i, j int) bool { return result.Nodes[i].ID < result.Nodes[j].ID })
|
sort.Slice(result.Nodes, func(i, j int) bool { return result.Nodes[i].ID < result.Nodes[j].ID })
|
||||||
return &result, nil
|
return &result, nil
|
||||||
}
|
}
|
||||||
|
@ -373,10 +373,10 @@ func TestGetTopologyInfo(t *testing.T) {
|
|||||||
expectedErr: true,
|
expectedErr: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "incorrect numa node ID",
|
name: "valid: missing numa node ID",
|
||||||
input: []string{"/dev/random"},
|
input: []string{"/dev/random"},
|
||||||
output: nil,
|
output: &pluginapi.TopologyInfo{},
|
||||||
expectedErr: true,
|
expectedErr: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, test := range cases {
|
for _, test := range cases {
|
||||||
|
Loading…
Reference in New Issue
Block a user