mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
cleanup: reformat generateVolFromSnap() to rbdSnapshot.toVolume()
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
a517290ea7
commit
ba05c0f5f1
@ -98,23 +98,24 @@ func cleanUpSnapshot(
|
||||
return nil
|
||||
}
|
||||
|
||||
func generateVolFromSnap(rbdSnap *rbdSnapshot) *rbdVolume {
|
||||
vol := new(rbdVolume)
|
||||
vol.ClusterID = rbdSnap.ClusterID
|
||||
vol.VolID = rbdSnap.VolID
|
||||
vol.Monitors = rbdSnap.Monitors
|
||||
vol.Pool = rbdSnap.Pool
|
||||
vol.JournalPool = rbdSnap.JournalPool
|
||||
vol.RadosNamespace = rbdSnap.RadosNamespace
|
||||
vol.RbdImageName = rbdSnap.RbdSnapName
|
||||
vol.ImageID = rbdSnap.ImageID
|
||||
// copyEncryptionConfig cannot be used here because the volume and the
|
||||
// snapshot will have the same volumeID which cases the panic in
|
||||
// copyEncryptionConfig function.
|
||||
vol.blockEncryption = rbdSnap.blockEncryption
|
||||
vol.fileEncryption = rbdSnap.fileEncryption
|
||||
|
||||
return vol
|
||||
func (rbdSnap *rbdSnapshot) toVolume() *rbdVolume {
|
||||
return &rbdVolume{
|
||||
rbdImage: rbdImage{
|
||||
ClusterID: rbdSnap.ClusterID,
|
||||
VolID: rbdSnap.VolID,
|
||||
Monitors: rbdSnap.Monitors,
|
||||
Pool: rbdSnap.Pool,
|
||||
JournalPool: rbdSnap.JournalPool,
|
||||
RadosNamespace: rbdSnap.RadosNamespace,
|
||||
RbdImageName: rbdSnap.RbdSnapName,
|
||||
ImageID: rbdSnap.ImageID,
|
||||
// copyEncryptionConfig cannot be used here because the volume and the
|
||||
// snapshot will have the same volumeID which cases the panic in
|
||||
// copyEncryptionConfig function.
|
||||
blockEncryption: rbdSnap.blockEncryption,
|
||||
fileEncryption: rbdSnap.fileEncryption,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func undoSnapshotCloning(
|
||||
|
Reference in New Issue
Block a user