Skip to content

Commit

Permalink
Merge pull request #97 from openebs/lvm_custom_topology
Browse files Browse the repository at this point in the history
fix lvm-localpv custom topology test for late bindings
  • Loading branch information
w3aman authored Nov 8, 2024
2 parents 472b7ba + 4855b57 commit ea271bc
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
)

const allowedTopologyEnvVarName = "ALLOWED_TOPOLOGIES"

var nodeConfig lvm.LvmNodesDevicePvVgConfig
var appInstances []*k8stest.FioApplication
var targetNode, key string
Expand Down Expand Up @@ -243,11 +245,13 @@ func customTopologyWfcTest(decor string, engine common.OpenEbsEngine, volType co
label := fmt.Sprintf("%s=%s", productConfig.LocalEngineComponentPodLabelKey,
productConfig.LvmEngineComponentDsPodLabelValue)

// Restart lvm daemonset pods after applying node label with key
// so that csinode kubernetes object for local.csi.openebs.io plugin driver picks
// that particular topology key for scheduling volume
err = k8stest.DeletePodsByLabel(label, common.NSOpenEBS())
Expect(err).To(BeNil(), "failed to restart lvm daemonset pods with label %s", label)
updatedEnvVarValue := fmt.Sprintf("kubernetes.io/hostname,%s", key)

// we have to set env in the daemonset yaml for lvm-local like this
// kubectl set env daemonset/openebs-lvm-localpv-node -n openebs ALLOWED_TOPOLOGIES=kubernetes.io/hostname,key
// this updation will automatically restart daemonset pods
_, err = k8stest.UpdateDemonsetContainerEnv(productConfig.LvmEngineDaemonSetName, productConfig.LvmEnginePluginContainerName, common.NSOpenEBS(), allowedTopologyEnvVarName, updatedEnvVarValue)
Expect(err).To(BeNil(), "failed to update env values")

// verify lvm daemonset to be ready
Eventually(func() bool {
Expand Down

0 comments on commit ea271bc

Please sign in to comment.