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>
(cherry picked from commit 08728b631b)
This commit is contained in:
Rakshith R 2021-07-09 14:33:40 +05:30 committed by mergify[bot]
parent 1470af8316
commit 33509ca90a

View File

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