Skip to content

Commit

Permalink
rbd: app failing to mount with volumenameprefix
Browse files Browse the repository at this point in the history
Signed-off-by: riya-singhal31 <[email protected]>
  • Loading branch information
riya-singhal31 committed Jul 19, 2023
1 parent 47b79c8 commit b16fde9
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3099,6 +3099,85 @@ var _ = Describe("RBD", func() {
validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType)
})

By("creating an app with a PVC, using a topology constrained StorageClass with volumenameprefix", func() {
By("checking node has required CSI topology labels set", func() {
err := checkNodeHasLabel(f.ClientSet, nodeCSIRegionLabel, regionValue)
if err != nil {
framework.Failf("failed to check node label: %v", err)
}
err = checkNodeHasLabel(f.ClientSet, nodeCSIZoneLabel, zoneValue)
if err != nil {
framework.Failf("failed to check node label: %v", err)
}
})

By("creating a StorageClass with delayed binding mode and CSI topology parameter")
err := deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
framework.Failf("failed to delete storageclass: %v", err)
}
topologyConstraint := "[{\"poolName\":\"" + rbdTopologyPool + "\",\"domainSegments\":" +
"[{\"domainLabel\":\"region\",\"value\":\"" + regionValue + "\"}," +
"{\"domainLabel\":\"zone\",\"value\":\"" + zoneValue + "\"}]}]"
err = createRBDStorageClass(f.ClientSet, f, defaultSCName,
map[string]string{"volumeBindingMode": "WaitForFirstConsumer"},
map[string]string{"topologyConstrainedPools": topologyConstraint,
"volumeNamePrefix": "foo-bar-"}, deletePolicy)
if err != nil {
framework.Failf("failed to create storageclass: %v", err)
}

By("creating an app using a PV from the delayed binding mode StorageClass")
pvc, app, err := createPVCAndAppBinding(pvcPath, appPath, f, 0)
if err != nil {
framework.Failf("failed to create PVC and application: %v", err)
}

By("ensuring created PV has required node selector values populated")
err = checkPVSelectorValuesForPVC(f, pvc)
if err != nil {
framework.Failf("failed to check pv selector values: %v", err)
}
By("ensuring created PV has its image in the topology specific pool")
err = checkPVCImageInPool(f, pvc, rbdTopologyPool)
if err != nil {
framework.Failf("failed to check image in pool: %v", err)
}

By("ensuring created PV has its image journal in the topology specific pool")
err = checkPVCImageJournalInPool(f, pvc, rbdTopologyPool)
if err != nil {
framework.Failf("failed to check image journal: %v", err)
}

By("ensuring created PV has its CSI journal in the CSI journal specific pool")
err = checkPVCCSIJournalInPool(f, pvc, "replicapool")
if err != nil {
framework.Failf("failed to check csi journal in pool: %v", err)
}

err = deleteJournalInfoInPool(f, pvc, "replicapool")
if err != nil {
framework.Failf("failed to delete omap data: %v", err)
}
err = deletePVCAndApp("", f, pvc, app)
if err != nil {
framework.Failf("failed to delete PVC and application: %v", err)
}
validateRBDImageCount(f, 0, defaultRBDPool)
validateOmapCount(f, 0, rbdType, defaultRBDPool, volumesType)

err = deleteResource(rbdExamplePath + "storageclass.yaml")
if err != nil {
framework.Failf("failed to delete storageclass: %v", err)
}

err = createRBDStorageClass(f.ClientSet, f, defaultSCName, nil, nil, deletePolicy)
if err != nil {
framework.Failf("failed to create storageclass: %v", err)
}
})

// Mount pvc to pod with invalid mount option,expected that
// mounting will fail
By("Mount pvc to pod with invalid mount option", func() {
Expand Down

0 comments on commit b16fde9

Please sign in to comment.