Add resize check for XFS formatted FS

Lock out parellel requests against same volumeID
Remove pod after resize and validation in E2E

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2019-12-13 15:59:33 +05:30
committed by mergify[bot]
parent 8e437244de
commit 7c8e66e427
5 changed files with 68 additions and 39 deletions

View File

@ -116,7 +116,6 @@ var _ = Describe("RBD", func() {
By("create a PVC and Bind it to an app with normal user", func() {
validateNormalUserPVCAccess(pvcPath, f)
})
// Skipping ext4 FS testing
By("create a PVC and Bind it to an app with ext4 as the FS ", func() {
deleteResource(rbdExamplePath + "storageclass.yaml")
@ -250,8 +249,16 @@ var _ = Describe("RBD", func() {
e2elog.Logf("failed to resize PVC %v", err)
Fail(err.Error())
}
}
deleteResource(rbdExamplePath + "storageclass.yaml")
createRBDStorageClass(f.ClientSet, f, map[string]string{"csi.storage.k8s.io/fstype": "xfs"})
err = resizePVCAndValidateSize(pvcPath, appPath, f)
if err != nil {
e2elog.Logf("failed to resize PVC %v", err)
Fail(err.Error())
}
}
})
By("Test unmount after nodeplugin restart", func() {

View File

@ -834,12 +834,17 @@ func expandPVCSize(c kubernetes.Interface, pvc *v1.PersistentVolumeClaim, size s
}
pvcConditions := updatedPVC.Status.Conditions
if len(pvcConditions) > 0 {
if pvcConditions[0].Type == v1.PersistentVolumeClaimResizing {
return true, nil
}
e2elog.Logf("pvc state %v", pvcConditions[0].Type)
if pvcConditions[0].Type == v1.PersistentVolumeClaimResizing || pvcConditions[0].Type == v1.PersistentVolumeClaimFileSystemResizePending {
return false, nil
}
}
return false, nil
if updatedPVC.Status.Capacity[v1.ResourceStorage] != resource.MustParse(size) {
e2elog.Logf("current size in status %v,expected size %v", updatedPVC.Status.Capacity[v1.ResourceStorage], resource.MustParse(size))
return false, nil
}
return true, nil
})
}
@ -889,6 +894,10 @@ func resizePVCAndValidateSize(pvcPath, appPath string, f *framework.Framework) e
return err
}
err = checkDirSize(app, f, &opt, expandSize, deployTimeout)
if err != nil {
return err
}
err = deletePVCAndApp("", f, resizePvc, app)
return err
}