mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rbd: fix topology snapshot pool
Restoring a snapshot with a new PVC results with a wrong dataPoolName in case of initial volume linked to a storageClass with topology constraints and erasure coding. Signed-off-by: Thibaut Blanchard <thibaut.blanchard@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
134603540b
commit
e874c9c11b
@ -37,7 +37,7 @@ func checkAndReportError(t *testing.T, msg string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestFindPoolAndTopology also tests MatchTopologyForPool.
|
||||
// TestFindPoolAndTopology also tests MatchPoolAndTopology.
|
||||
func TestFindPoolAndTopology(t *testing.T) {
|
||||
t.Parallel()
|
||||
var err error
|
||||
@ -319,15 +319,15 @@ func TestFindPoolAndTopology(t *testing.T) {
|
||||
t.Errorf("expected data pool to be named ec-%s, got %s", poolName, dataPoolName)
|
||||
}
|
||||
|
||||
// TEST: MatchTopologyForPool
|
||||
// TEST: MatchPoolAndTopology
|
||||
// check for non-existent pool
|
||||
_, err = MatchTopologyForPool(&validMultipleTopoPools, &validAccReq, pool1+"fuzz")
|
||||
_, _, _, err = MatchPoolAndTopology(&validMultipleTopoPools, &validAccReq, pool1+"fuzz")
|
||||
if err == nil {
|
||||
t.Errorf("expected failure due to non-existent pool name (%s) got success", pool1+"fuzz")
|
||||
}
|
||||
|
||||
// check for existing pool
|
||||
topoSegment, err = MatchTopologyForPool(&validMultipleTopoPools, &validAccReq, pool1)
|
||||
_, _, topoSegment, err = MatchPoolAndTopology(&validMultipleTopoPools, &validAccReq, pool1)
|
||||
err = checkOutput(err, pool1, topoSegment)
|
||||
checkAndReportError(t, "expected success got:", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user