Skip to content

Commit

Permalink
rbd: extending prefix test to mount the app to pvc
Browse files Browse the repository at this point in the history
Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
  • Loading branch information
riya-singhal31 committed Aug 5, 2023
1 parent 47af7de commit cdc6c5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 4 additions & 9 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2833,14 +2833,9 @@ var _ = Describe("RBD", func() {
framework.Failf("failed to create storageclass: %v", err)
}
// set up PVC
pvc, err := loadPVC(pvcPath)
if err != nil {
framework.Failf("failed to load PVC: %v", err)
}
pvc.Namespace = f.UniqueName
err = createPVCAndvalidatePV(f.ClientSet, pvc, deployTimeout)
pvc, app, err := createPVCAndAppBinding(pvcPath, appPath, f, 0)
if err != nil {
framework.Failf("failed to create PVC: %v", err)
framework.Failf("failed to create PVC and application: %v", err)
}

// validate created backend rbd images
Expand All @@ -2862,9 +2857,9 @@ var _ = Describe("RBD", func() {
}

// clean up after ourselves
err = deletePVCAndValidatePV(f.ClientSet, pvc, deployTimeout)
err = deletePVCAndApp("", f, pvc, app)
if err != nil {
framework.Failf("failed to delete PVC: %v", err)
framework.Failf("failed to delete PVC and application: %v", err)
}
// validate created backend rbd images
validateRBDImageCount(f, 0, defaultRBDPool)
Expand Down
3 changes: 2 additions & 1 deletion internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ func (cs *ControllerServer) parseVolCreateRequest(

// start with pool the same as journal pool, in case there is a topology
// based split, pool for the image will be updated subsequently
rbdVol.JournalPool = rbdVol.Pool

// store topology information from the request
rbdVol.TopologyPools, rbdVol.TopologyRequirement, err = util.GetTopologyFromRequest(req)
Expand All @@ -227,6 +226,8 @@ func (cs *ControllerServer) parseVolCreateRequest(
return nil, status.Error(codes.InvalidArgument, err.Error())
}

rbdVol.JournalPool = rbdVol.Pool

// NOTE: rbdVol does not contain VolID and RbdImageName populated, everything
// else is populated post create request parsing
return rbdVol, nil
Expand Down

0 comments on commit cdc6c5e

Please sign in to comment.