From 78bde32285684f1300d2c689b974edc9421bbe75 Mon Sep 17 00:00:00 2001 From: Ivan Kolodiazhnyi Date: Thu, 6 Jun 2024 18:20:01 +0300 Subject: [PATCH] Remove webhook validation for InfiniBand and RDMA Since we always deploy both mutation and validating webhooks there is no need to validate policy for InfiniBand and RDMA enabled because mutating webhook will wet 'isRdma' flag to 'true' for InfiniBand'. --- pkg/webhook/validate.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/webhook/validate.go b/pkg/webhook/validate.go index 6937aecc5..95c481470 100644 --- a/pkg/webhook/validate.go +++ b/pkg/webhook/validate.go @@ -213,10 +213,6 @@ func staticValidateSriovNetworkNodePolicy(cr *sriovnetworkv1.SriovNetworkNodePol if cr.Spec.DeviceType == consts.DeviceTypeVfioPci && cr.Spec.IsRdma { return false, fmt.Errorf("'deviceType: vfio-pci' conflicts with 'isRdma: true'; Set 'deviceType' to (string)'netdevice' Or Set 'isRdma' to (bool)'false'") } - if strings.EqualFold(cr.Spec.LinkType, consts.LinkTypeIB) && !cr.Spec.IsRdma { - return false, fmt.Errorf("'linkType: ib or IB' requires 'isRdma: true'; Set 'isRdma' to (bool)'true'") - } - // vdpa: deviceType must be set to 'netdevice' if cr.Spec.DeviceType != consts.DeviceTypeNetDevice && (cr.Spec.VdpaType == consts.VdpaTypeVirtio || cr.Spec.VdpaType == consts.VdpaTypeVhost) { return false, fmt.Errorf("'deviceType: %s' conflicts with '%s'; Set 'deviceType' to (string)'netdevice' Or Remove 'vdpaType'", cr.Spec.DeviceType, cr.Spec.VdpaType)