From 3a52152bc3aefc830bd1b1a262d46dab0e255e4c Mon Sep 17 00:00:00 2001 From: rohan2794 Date: Wed, 9 Oct 2024 12:52:02 +0530 Subject: [PATCH] feat(RDMA): enable and disable RDMA via helm upgrade Signed-off-by: rohan2794 --- common/k8sinstall/util.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/common/k8sinstall/util.go b/common/k8sinstall/util.go index 7c6f25a..571e84e 100644 --- a/common/k8sinstall/util.go +++ b/common/k8sinstall/util.go @@ -220,3 +220,31 @@ func ScaleZfsControllerViaHelm(expected_replica int32) (int32, error) { return orig_replicas, nil } + +// SetRdmaViaHelm enable and disable RDMA +func SetRdmaViaHelm(enableRdma bool, iface string) error { + e2eCfg := e2e_config.GetConfig() + values := map[string]interface{}{ + "io_engine.target.nvmf.rdma.enabled": enableRdma, + "io_engine.target.nvmf.iface": iface, + } + + err := apps.UpgradeHelmChart(e2eCfg.Product.ChartName, + common.NSMayastor(), + e2eCfg.Product.HelmReleaseName, + values, + ) + if err != nil { + return fmt.Errorf("failed to set RDMA via helm, error: %v", err) + } + + ready, err := k8stest.OpenEBSReady(10, 340) + if err != nil { + return err + } + if !ready { + return fmt.Errorf("all pods not ready, openebs ready check failed") + } + + return nil +}