From 1354cfbf03f3d2d2de60c7f5b2afccef90d5b999 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Wed, 3 Nov 2021 15:28:19 +0530 Subject: [PATCH] e2e: remove 1.16 based test enablement in rbd considering we are far out of this release and only care about kubernetes releases from v1.20, there is no need to have this version check in place for the tests. Signed-off-by: Humble Chirammal --- e2e/rbd.go | 90 +++++++++++++++++------------------------------------- 1 file changed, 28 insertions(+), 62 deletions(-) diff --git a/e2e/rbd.go b/e2e/rbd.go index 612a9a9d9..17cf8ae85 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -1116,26 +1116,19 @@ var _ = Describe("RBD", func() { }) By("create a PVC-PVC clone and bind it to an app", func() { - // pvc clone is only supported from v1.16+ - if k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - validatePVCClone( - defaultCloneCount, - pvcPath, - appPath, - pvcSmartClonePath, - appSmartClonePath, - noKMS, - noPVCValidation, - f) - } + validatePVCClone( + defaultCloneCount, + pvcPath, + appPath, + pvcSmartClonePath, + appSmartClonePath, + noKMS, + noPVCValidation, + f) + }) By("create a thick-provisioned PVC-PVC clone and bind it to an app", func() { - // pvc clone is only supported from v1.16+ - if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - Skip("pvc clone is only supported from v1.16+") - } - err := deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { e2elog.Failf("failed to delete storageclass with error %v", err) @@ -1160,10 +1153,6 @@ var _ = Describe("RBD", func() { }) By("create an encrypted PVC snapshot and restore it for an app with VaultKMS", func() { - if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - Skip("pvc clone is only supported from v1.16+") - } - err := deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { e2elog.Failf("failed to delete storageclass with error %v", err) @@ -1194,9 +1183,6 @@ var _ = Describe("RBD", func() { }) By("Validate PVC restore from vaultKMS to vaultTenantSAKMS", func() { - if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - Skip("pvc clone is only supported from v1.16+") - } restoreSCName := "restore-sc" err := deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { @@ -1251,9 +1237,6 @@ var _ = Describe("RBD", func() { }) By("Validate thick PVC restore from vaultKMS to userSecretsMetadataKMS", func() { - if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - Skip("pvc clone is only supported from v1.16+") - } restoreSCName := "restore-sc" err := deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { @@ -1323,10 +1306,6 @@ var _ = Describe("RBD", func() { }) By("create an encrypted PVC-PVC clone and bind it to an app", func() { - if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - Skip("pvc clone is only supported from v1.16+") - } - err := deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { e2elog.Failf("failed to delete storageclass with error %v", err) @@ -1353,10 +1332,6 @@ var _ = Describe("RBD", func() { }) By("create an encrypted PVC-PVC clone and bind it to an app with VaultKMS", func() { - if !k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - Skip("pvc clone is only supported from v1.16+") - } - err := deleteResource(rbdExamplePath + "storageclass.yaml") if err != nil { e2elog.Failf("failed to delete storageclass with error %v", err) @@ -1389,22 +1364,19 @@ var _ = Describe("RBD", func() { } }) By("create a Block mode PVC-PVC clone and bind it to an app", func() { - v, err := f.ClientSet.Discovery().ServerVersion() + _, err := f.ClientSet.Discovery().ServerVersion() if err != nil { e2elog.Failf("failed to get server version with error %v", err) } - // pvc clone is only supported from v1.16+ - if v.Major > "1" || (v.Major == "1" && v.Minor >= "16") { - validatePVCClone( - defaultCloneCount, - rawPvcPath, - rawAppPath, - pvcBlockSmartClonePath, - appBlockSmartClonePath, - noKMS, - noPVCValidation, - f) - } + validatePVCClone( + defaultCloneCount, + rawPvcPath, + rawAppPath, + pvcBlockSmartClonePath, + appBlockSmartClonePath, + noKMS, + noPVCValidation, + f) }) By("create/delete multiple PVCs and Apps", func() { totalCount := 2 @@ -1485,15 +1457,12 @@ var _ = Describe("RBD", func() { }) By("Resize Block PVC and check Device size", func() { - // Block PVC resize is supported in kubernetes 1.16+ - if k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - err := resizePVCAndValidateSize(rawPvcPath, rawAppPath, f) - if err != nil { - e2elog.Failf("failed to resize block PVC with error %v", err) - } - // validate created backend rbd images - validateRBDImageCount(f, 0, defaultRBDPool) + err := resizePVCAndValidateSize(rawPvcPath, rawAppPath, f) + if err != nil { + e2elog.Failf("failed to resize block PVC with error %v", err) } + // validate created backend rbd images + validateRBDImageCount(f, 0, defaultRBDPool) }) By("Test unmount after nodeplugin restart", func() { @@ -2485,12 +2454,9 @@ var _ = Describe("RBD", func() { } // Resize Block PVC and check Device size within the namespace - // Block PVC resize is supported in kubernetes 1.16+ - if k8sVersionGreaterEquals(f.ClientSet, 1, 16) { - err = resizePVCAndValidateSize(rawPvcPath, rawAppPath, f) - if err != nil { - e2elog.Failf("failed to resize block PVC with error %v", err) - } + err = resizePVCAndValidateSize(rawPvcPath, rawAppPath, f) + if err != nil { + e2elog.Failf("failed to resize block PVC with error %v", err) } // Resize Filesystem PVC and check application directory size