Skip to content

Commit

Permalink
Fix the validation webhook for virtual environments
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba committed Apr 13, 2022
1 parent 2c52beb commit 04a3f69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deploy/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ data:
Broadcom_bnxt_BCM57414_2x25G: "14e4 16d7 16dc"
Broadcom_bnxt_BCM75508_2x100G: "14e4 1750 1806"
Qlogic_qede_QL45000_50G: "1077 1654 1664"

Red_Hat_Virtio_network_device: "1af4 1000 1000"
2 changes: 1 addition & 1 deletion deployment/sriov-network-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ data:
Broadcom_bnxt_BCM57414_2x25G: "14e4 16d7 16dc"
Broadcom_bnxt_BCM75508_2x100G: "14e4 1750 1806"
Qlogic_qede_QL45000_50G: "1077 1654 1664"

Red_Hat_Virtio_network_device: "1af4 1000 1000"
5 changes: 4 additions & 1 deletion pkg/webhook/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,11 @@ func validateNicModel(selector *sriovnetworkv1.SriovNetworkNicSelector, iface *s
return true
}

// Check the vendor and device ID of the VF only if we are on a virtual environment
for key := range utils.PlatformMap {
if strings.Contains(strings.ToLower(node.Spec.ProviderID), strings.ToLower(key)) && sriovnetworkv1.IsVfSupportedModel(iface.Vendor, iface.DeviceID) {
if strings.Contains(strings.ToLower(node.Spec.ProviderID), strings.ToLower(key)) &&
selector.NetFilter != "" && selector.NetFilter == iface.NetFilter &&
sriovnetworkv1.IsVfSupportedModel(iface.Vendor, iface.DeviceID) {
return true
}
}
Expand Down

0 comments on commit 04a3f69

Please sign in to comment.