mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
rbd: fix snapshot deletion by resolving image names correctly
When creating a Snapshot with the new NewSnapshotByID() function, the name of the RBD-image that is created is the same as the name of the Snapshot. The `RbdImageName` points to the name of parent image, which causes deleting the Snapshot to delete the parent image instead. Correcting the `RbdImageName` and setting it to the `RbdSnapName` makes sure that upon deletion, the Snapshot RBD-image is removed, and not the parent image. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
fdccba1f33
commit
e011e74b9d
@ -212,6 +212,11 @@ func (mgr *rbdManager) GetSnapshotByID(ctx context.Context, id string) (types.Sn
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: The snapshot will have RbdImageName set to the image that was
|
||||
// used as source. This is not correct for group snapshots images, and
|
||||
// need to be fixed. See rbdVolume.NewSnapshotByID() for more details.
|
||||
snapshot.RbdImageName = snapshot.RbdSnapName
|
||||
|
||||
return snapshot, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user