e2e: add getPersistentVolumeClaim helper function

added getPersistentVolumeClaim helper function
to get the PVC and also try if there is any API
error to improve the CI.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-05-06 12:29:50 +05:30
committed by mergify[bot]
parent c880061882
commit 89d9ec0823
7 changed files with 33 additions and 30 deletions

View File

@ -145,9 +145,7 @@ func unmountCephFSVolume(f *framework.Framework, appName, pvcName string) error
return fmt.Errorf("failed to get pod: %w", err)
}
pvc, err := f.ClientSet.CoreV1().
PersistentVolumeClaims(f.UniqueName).
Get(context.TODO(), pvcName, metav1.GetOptions{})
pvc, err := getPersistentVolumeClaim(f.ClientSet, f.UniqueName, pvcName)
if err != nil {
e2elog.Logf("Error occurred getting PVC %s in namespace %s", pvcName, f.UniqueName)