From efabe70a46f1e3805c3c84aade1f39e4186f5b57 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 25 Jul 2022 10:10:20 +0530 Subject: [PATCH] e2e: remove kubernetes 1.22 check We run CI jobs on kubernetes 1.22 by default and we dont need to have a check to make sure we have atleast Kubernetes 1.22 for few tests. As we have CI runs on 1.22 by default, Removing unwanted check. updates: #3086 depends-on #3255 Signed-off-by: Madhu Rajanna --- e2e/cephfs.go | 78 +++++++++++++-------------- e2e/nfs.go | 74 +++++++++++++------------- e2e/rbd.go | 144 ++++++++++++++++++++++++-------------------------- e2e/utils.go | 2 +- 4 files changed, 145 insertions(+), 153 deletions(-) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index 7c8a88466..4520c8adc 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -328,51 +328,49 @@ var _ = Describe(cephfsType, func() { }) By("verify RWOP volume support", func() { - if k8sVersionGreaterEquals(f.ClientSet, 1, 22) { - err := createCephfsStorageClass(f.ClientSet, f, true, nil) - if err != nil { - e2elog.Failf("failed to create CephFS storageclass: %v", err) - } - pvc, err := loadPVC(pvcRWOPPath) - if err != nil { - e2elog.Failf("failed to load PVC: %v", err) - } - pvc.Namespace = f.UniqueName + err := createCephfsStorageClass(f.ClientSet, f, true, nil) + if err != nil { + e2elog.Failf("failed to create CephFS storageclass: %v", err) + } + pvc, err := loadPVC(pvcRWOPPath) + if err != nil { + e2elog.Failf("failed to load PVC: %v", err) + } + pvc.Namespace = f.UniqueName - // create application - app, err := loadApp(appRWOPPath) - if err != nil { - e2elog.Failf("failed to load application: %v", err) - } - app.Namespace = f.UniqueName - baseAppName := app.Name + // create application + app, err := loadApp(appRWOPPath) + if err != nil { + e2elog.Failf("failed to load application: %v", err) + } + app.Namespace = f.UniqueName + baseAppName := app.Name - err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) - if err != nil { - if rwopMayFail(err) { - e2elog.Logf("RWOP is not supported: %v", err) + err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) + if err != nil { + if rwopMayFail(err) { + e2elog.Logf("RWOP is not supported: %v", err) - return - } - e2elog.Failf("failed to create PVC: %v", err) + return } - err = createApp(f.ClientSet, app, deployTimeout) - if err != nil { - e2elog.Failf("failed to create application: %v", err) - } - validateSubvolumeCount(f, 1, fileSystemName, subvolumegroup) - validateOmapCount(f, 1, cephfsType, metadataPool, volumesType) + e2elog.Failf("failed to create PVC: %v", err) + } + err = createApp(f.ClientSet, app, deployTimeout) + if err != nil { + e2elog.Failf("failed to create application: %v", err) + } + validateSubvolumeCount(f, 1, fileSystemName, subvolumegroup) + validateOmapCount(f, 1, cephfsType, metadataPool, volumesType) - err = validateRWOPPodCreation(f, pvc, app, baseAppName) - if err != nil { - e2elog.Failf("failed to validate RWOP pod creation: %v", err) - } - validateSubvolumeCount(f, 0, fileSystemName, subvolumegroup) - validateOmapCount(f, 0, cephfsType, metadataPool, volumesType) - err = deleteResource(cephFSExamplePath + "storageclass.yaml") - if err != nil { - e2elog.Failf("failed to delete CephFS storageclass: %v", err) - } + err = validateRWOPPodCreation(f, pvc, app, baseAppName) + if err != nil { + e2elog.Failf("failed to validate RWOP pod creation: %v", err) + } + validateSubvolumeCount(f, 0, fileSystemName, subvolumegroup) + validateOmapCount(f, 0, cephfsType, metadataPool, volumesType) + err = deleteResource(cephFSExamplePath + "storageclass.yaml") + if err != nil { + e2elog.Failf("failed to delete CephFS storageclass: %v", err) } }) diff --git a/e2e/nfs.go b/e2e/nfs.go index 89860b96e..061fb6bac 100644 --- a/e2e/nfs.go +++ b/e2e/nfs.go @@ -371,49 +371,47 @@ var _ = Describe("nfs", func() { }) By("verify RWOP volume support", func() { - if k8sVersionGreaterEquals(f.ClientSet, 1, 22) { - err := createNFSStorageClass(f.ClientSet, f, false, nil) - if err != nil { - e2elog.Failf("failed to create CephFS storageclass: %v", err) - } - pvc, err := loadPVC(pvcRWOPPath) - if err != nil { - e2elog.Failf("failed to load PVC: %v", err) - } - pvc.Namespace = f.UniqueName + err := createNFSStorageClass(f.ClientSet, f, false, nil) + if err != nil { + e2elog.Failf("failed to create CephFS storageclass: %v", err) + } + pvc, err := loadPVC(pvcRWOPPath) + if err != nil { + e2elog.Failf("failed to load PVC: %v", err) + } + pvc.Namespace = f.UniqueName - // create application - app, err := loadApp(appRWOPPath) - if err != nil { - e2elog.Failf("failed to load application: %v", err) - } - app.Namespace = f.UniqueName - baseAppName := app.Name + // create application + app, err := loadApp(appRWOPPath) + if err != nil { + e2elog.Failf("failed to load application: %v", err) + } + app.Namespace = f.UniqueName + baseAppName := app.Name - err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) - if err != nil { - if rwopMayFail(err) { - e2elog.Logf("RWOP is not supported: %v", err) + err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) + if err != nil { + if rwopMayFail(err) { + e2elog.Logf("RWOP is not supported: %v", err) - return - } - e2elog.Failf("failed to create PVC: %v", err) + return } - err = createApp(f.ClientSet, app, deployTimeout) - if err != nil { - e2elog.Failf("failed to create application: %v", err) - } - validateSubvolumeCount(f, 1, fileSystemName, defaultSubvolumegroup) + e2elog.Failf("failed to create PVC: %v", err) + } + err = createApp(f.ClientSet, app, deployTimeout) + if err != nil { + e2elog.Failf("failed to create application: %v", err) + } + validateSubvolumeCount(f, 1, fileSystemName, defaultSubvolumegroup) - err = validateRWOPPodCreation(f, pvc, app, baseAppName) - if err != nil { - e2elog.Failf("failed to validate RWOP pod creation: %v", err) - } - validateSubvolumeCount(f, 0, fileSystemName, defaultSubvolumegroup) - err = deleteResource(nfsExamplePath + "storageclass.yaml") - if err != nil { - e2elog.Failf("failed to delete CephFS storageclass: %v", err) - } + err = validateRWOPPodCreation(f, pvc, app, baseAppName) + if err != nil { + e2elog.Failf("failed to validate RWOP pod creation: %v", err) + } + validateSubvolumeCount(f, 0, fileSystemName, defaultSubvolumegroup) + err = deleteResource(nfsExamplePath + "storageclass.yaml") + if err != nil { + e2elog.Failf("failed to delete CephFS storageclass: %v", err) } }) diff --git a/e2e/rbd.go b/e2e/rbd.go index 595131ab8..9975ebabe 100644 --- a/e2e/rbd.go +++ b/e2e/rbd.go @@ -876,85 +876,81 @@ var _ = Describe("RBD", func() { }) By("create a Block mode RWOP PVC and bind it to more than one app", func() { - if k8sVersionGreaterEquals(f.ClientSet, 1, 22) { - pvc, err := loadPVC(rawPVCRWOPPath) - if err != nil { - e2elog.Failf("failed to load PVC: %v", err) - } - pvc.Namespace = f.UniqueName - - app, err := loadApp(rawAppRWOPPath) - if err != nil { - e2elog.Failf("failed to load application: %v", err) - } - app.Namespace = f.UniqueName - baseAppName := app.Name - err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) - if err != nil { - if rwopMayFail(err) { - e2elog.Logf("RWOP is not supported: %v", err) - - return - } - e2elog.Failf("failed to create PVC: %v", err) - } - // validate created backend rbd images - validateRBDImageCount(f, 1, defaultRBDPool) - validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType) - - err = createApp(f.ClientSet, app, deployTimeout) - if err != nil { - e2elog.Failf("failed to create application: %v", err) - } - err = validateRWOPPodCreation(f, pvc, app, baseAppName) - if err != nil { - e2elog.Failf("failed to validate RWOP pod creation: %v", err) - } - // validate created backend rbd images - validateRBDImageCount(f, 0, defaultRBDPool) - validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType) + pvc, err := loadPVC(rawPVCRWOPPath) + if err != nil { + e2elog.Failf("failed to load PVC: %v", err) } + pvc.Namespace = f.UniqueName + + app, err := loadApp(rawAppRWOPPath) + if err != nil { + e2elog.Failf("failed to load application: %v", err) + } + app.Namespace = f.UniqueName + baseAppName := app.Name + err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) + if err != nil { + if rwopMayFail(err) { + e2elog.Logf("RWOP is not supported: %v", err) + + return + } + e2elog.Failf("failed to create PVC: %v", err) + } + // validate created backend rbd images + validateRBDImageCount(f, 1, defaultRBDPool) + validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType) + + err = createApp(f.ClientSet, app, deployTimeout) + if err != nil { + e2elog.Failf("failed to create application: %v", err) + } + err = validateRWOPPodCreation(f, pvc, app, baseAppName) + if err != nil { + e2elog.Failf("failed to validate RWOP pod creation: %v", err) + } + // validate created backend rbd images + validateRBDImageCount(f, 0, defaultRBDPool) + validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType) }) By("create a RWOP PVC and bind it to more than one app", func() { - if k8sVersionGreaterEquals(f.ClientSet, 1, 22) { - pvc, err := loadPVC(pvcRWOPPath) - if err != nil { - e2elog.Failf("failed to load PVC: %v", err) - } - pvc.Namespace = f.UniqueName - - app, err := loadApp(appRWOPPath) - if err != nil { - e2elog.Failf("failed to load application: %v", err) - } - app.Namespace = f.UniqueName - baseAppName := app.Name - err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) - if err != nil { - if rwopMayFail(err) { - e2elog.Logf("RWOP is not supported: %v", err) - - return - } - e2elog.Failf("failed to create PVC: %v", err) - } - // validate created backend rbd images - validateRBDImageCount(f, 1, defaultRBDPool) - validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType) - - err = createApp(f.ClientSet, app, deployTimeout) - if err != nil { - e2elog.Failf("failed to create application: %v", err) - } - err = validateRWOPPodCreation(f, pvc, app, baseAppName) - if err != nil { - e2elog.Failf("failed to validate RWOP pod creation: %v", err) - } - // validate created backend rbd images - validateRBDImageCount(f, 0, defaultRBDPool) - validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType) + pvc, err := loadPVC(pvcRWOPPath) + if err != nil { + e2elog.Failf("failed to load PVC: %v", err) } + pvc.Namespace = f.UniqueName + + app, err := loadApp(appRWOPPath) + if err != nil { + e2elog.Failf("failed to load application: %v", err) + } + app.Namespace = f.UniqueName + baseAppName := app.Name + err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout) + if err != nil { + if rwopMayFail(err) { + e2elog.Logf("RWOP is not supported: %v", err) + + return + } + e2elog.Failf("failed to create PVC: %v", err) + } + // validate created backend rbd images + validateRBDImageCount(f, 1, defaultRBDPool) + validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType) + + err = createApp(f.ClientSet, app, deployTimeout) + if err != nil { + e2elog.Failf("failed to create application: %v", err) + } + err = validateRWOPPodCreation(f, pvc, app, baseAppName) + if err != nil { + e2elog.Failf("failed to validate RWOP pod creation: %v", err) + } + // validate created backend rbd images + validateRBDImageCount(f, 0, defaultRBDPool) + validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType) }) By("create an erasure coded PVC and bind it to an app", func() { diff --git a/e2e/utils.go b/e2e/utils.go index be124960f..b5586490d 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -578,7 +578,7 @@ func validateNormalUserPVCAccess(pvcPath string, f *framework.Framework) error { if pvc.Spec.VolumeMode != nil { isBlockMode = (*pvc.Spec.VolumeMode == v1.PersistentVolumeBlock) } - if (!isBlockMode || k8sVersionGreaterEquals(f.ClientSet, 1, 22)) && !isOpenShift { + if !isBlockMode && !isOpenShift { err = getMetricsForPVC(f, pvc, deployTimeout) if err != nil { return err