Skip to content

Commit 4f5f503

Browse files
authored
Merge branch 'k8snetworkplumbingwg:master' into master
2 parents 9269acf + cf7573b commit 4f5f503

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/util/cluster/cluster.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,24 +263,24 @@ func (n *EnabledNodes) FindOneVfioSriovDevice() (string, sriovv1.InterfaceExt) {
263263

264264
// FindOneMellanoxSriovDevice retrieves a valid sriov device for the given node.
265265
func (n *EnabledNodes) FindOneMellanoxSriovDevice(node string) (*sriovv1.InterfaceExt, error) {
266-
s, ok := n.States[node]
267-
if !ok {
268-
return nil, fmt.Errorf("node %s not found", node)
269-
}
270-
271266
// return error here as mlx interfaces are not supported when secure boot is enabled
272267
// TODO: remove this when mlx support secure boot/lockdown mode
273268
if n.IsSecureBootEnabled[node] {
274269
return nil, fmt.Errorf("secure boot is enabled on the node mellanox cards are not supported")
275270
}
276271

277-
for _, itf := range s.Status.Interfaces {
278-
if itf.Vendor == mlxVendorID && sriovv1.IsSupportedModel(itf.Vendor, itf.DeviceID) {
279-
return &itf, nil
272+
devices, err := n.FindSriovDevices(node)
273+
if err != nil {
274+
return nil, fmt.Errorf("unable to find a mellanox sriov devices in node %s: %w", node, err)
275+
}
276+
277+
for _, nic := range devices {
278+
if nic.Vendor == mlxVendorID && sriovv1.IsSupportedModel(nic.Vendor, nic.DeviceID) {
279+
return nic, nil
280280
}
281281
}
282282

283-
return nil, fmt.Errorf("unable to find a mellanox sriov devices in node %s", node)
283+
return nil, fmt.Errorf("no Mellanox devices found in node %s. Available devices [%+v]", node, devices)
284284
}
285285

286286
// SriovStable tells if all the node states are in sync (and the cluster is ready for another round of tests)

0 commit comments

Comments
 (0)