rbd: fix vol.VolID in cloneFromSnapshot()

Volume generated from snap using genrateVolFromSnap
already copies volume ID correctly, therefore removing
`vol.VolID = rbdVol.VolID` which wrongly copies parent
Volume ID instead leading to error from copyEncryption()
on parent and clone volume ID being equal.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R 2021-07-09 14:33:40 +05:30 committed by mergify[bot]
parent bb60173a98
commit 08728b631b

View File

@ -1034,8 +1034,6 @@ func cloneFromSnapshot(
defer vol.Destroy()
if rbdVol.isEncrypted() {
// FIXME: vol.VolID should be different from rbdVol.VolID
vol.VolID = rbdVol.VolID
err = rbdVol.copyEncryptionConfig(&vol.rbdImage)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())