e2e: Add option to set mountoptions in sc

Updated E2E code to pass mountoptions when
creating a storageclass.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-05-18 18:37:17 +05:30 committed by mergify[bot]
parent 2f7e51076b
commit 78cdf9d4db

View File

@ -44,6 +44,7 @@ const (
rbdProvisionerSecretName = "rook-csi-rbd-provisioner" // nolint: gosec
rookTolBoxPodLabel = "app=rook-ceph-tools"
rbdmountOptions = "mountOptions"
)
var (
@ -311,6 +312,12 @@ func createRBDStorageClass(c kubernetes.Interface, f *framework.Framework, scOpt
value := scv1.VolumeBindingWaitForFirstConsumer
sc.VolumeBindingMode = &value
}
// comma separated mount options
if opt, ok := scOptions[rbdmountOptions]; ok {
mOpt := strings.Split(opt, ",")
sc.MountOptions = append(sc.MountOptions, mOpt...)
}
_, err := c.StorageV1().StorageClasses().Create(context.TODO(), &sc, metav1.CreateOptions{})
Expect(err).Should(BeNil())
}