mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-11 07:30:24 +00:00
rbd: prevent presetting the ImageID of a new volume
When a new volume is not created yet, the ImageID should not be set to the ID of the snapshot. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
parent
a228b14200
commit
58573a1d14
@ -107,7 +107,15 @@ func generateVolFromSnap(rbdSnap *rbdSnapshot) *rbdVolume {
|
|||||||
vol.JournalPool = rbdSnap.JournalPool
|
vol.JournalPool = rbdSnap.JournalPool
|
||||||
vol.RadosNamespace = rbdSnap.RadosNamespace
|
vol.RadosNamespace = rbdSnap.RadosNamespace
|
||||||
vol.RbdImageName = rbdSnap.RbdSnapName
|
vol.RbdImageName = rbdSnap.RbdSnapName
|
||||||
vol.ImageID = rbdSnap.ImageID
|
|
||||||
|
// /!\ WARNING /!\
|
||||||
|
//
|
||||||
|
// Do not set the ImageID to the ID of the snapshot, a new image will
|
||||||
|
// be created based on the returned rbdVolume. If the ImageID is set to
|
||||||
|
// the ID of the snapshot, accessing the new image by ID will actually
|
||||||
|
// access the snapshot!
|
||||||
|
// vol.ImageID = rbdSnap.ImageID
|
||||||
|
|
||||||
// copyEncryptionConfig cannot be used here because the volume and the
|
// copyEncryptionConfig cannot be used here because the volume and the
|
||||||
// snapshot will have the same volumeID which cases the panic in
|
// snapshot will have the same volumeID which cases the panic in
|
||||||
// copyEncryptionConfig function.
|
// copyEncryptionConfig function.
|
||||||
|
Loading…
Reference in New Issue
Block a user