e2e: validate the error return instead of object for consitency

If loadPVC() fails, it return error and we expect the PVC object
to be nil too. In many places we check on the error and exit.
However in few places we are looking at PVC object.
This commit make the condition check on `err` instead of `PVC`
object for consistency.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2020-10-20 15:25:09 +05:30
committed by mergify[bot]
parent dc4da25a30
commit b4452f0787
5 changed files with 8 additions and 8 deletions

View File

@ -142,7 +142,7 @@ var _ = Describe("CephFS Upgrade Testing", func() {
label := make(map[string]string)
pvc, err = loadPVC(pvcPath)
if pvc == nil {
if err != nil {
e2elog.Failf("failed to load pvc with error %v", err)
}
pvc.Namespace = f.UniqueName