mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +00:00
cleanup: error is not nil but returns nil
In few places the error is not nil still it returns nil. Updates: #1586 Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
parent
5dc60126e4
commit
c851b69160
@ -68,7 +68,7 @@ func createPVCAndvalidatePV(c kubernetes.Interface, pvc *v1.PersistentVolumeClai
|
||||
}
|
||||
err = e2epv.WaitOnPVandPVC(c, pvc.Namespace, pv, pvc)
|
||||
if err != nil {
|
||||
return false, nil
|
||||
return false, fmt.Errorf("failed to wait for the pv and pvc to bind: %w", err)
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
|
@ -44,7 +44,7 @@ func createRBDStorageClass(
|
||||
scPath := fmt.Sprintf("%s/%s", rbdExamplePath, "storageclass.yaml")
|
||||
sc, err := getStorageClass(scPath)
|
||||
if err != nil {
|
||||
return nil
|
||||
return fmt.Errorf("failed to get sc: %w", err)
|
||||
}
|
||||
if name != "" {
|
||||
sc.Name = name
|
||||
|
@ -311,7 +311,7 @@ func validateNormalUserPVCAccess(pvcPath string, f *framework.Framework) error {
|
||||
}
|
||||
_, stdErr, err := execCommandInPod(f, "echo testing > /target/testing", app.Namespace, &opt)
|
||||
if err != nil {
|
||||
return nil
|
||||
return fmt.Errorf("failed to exec command in pod: %w", err)
|
||||
}
|
||||
if stdErr != "" {
|
||||
return fmt.Errorf("failed to touch a file as non-root user %v", stdErr)
|
||||
@ -395,7 +395,7 @@ func checkDataPersist(pvcPath, appPath string, f *framework.Framework) error {
|
||||
|
||||
_, stdErr, err := execCommandInPod(f, fmt.Sprintf("echo %s > %s", data, filePath), app.Namespace, &opt)
|
||||
if err != nil {
|
||||
return nil
|
||||
return fmt.Errorf("failed to exec command in pod: %w", err)
|
||||
}
|
||||
if stdErr != "" {
|
||||
return fmt.Errorf("failed to write data to a file %v", stdErr)
|
||||
|
Loading…
Reference in New Issue
Block a user