rbd: reset dummy image id

dummy image rbdVolume struct is derived
from the actual one rbdVolume of the
volumeID sent in the EnableVolumeReplication
request. and the dummy rbdVolume struct contains
the image id of the actual volume because
of that when we are repairing the dummy
image the image is sent to trash but not
deleted due to the wrong image ID. resetting
the image id will makes sure the image id
is fetching from ceph cluster and same
image id will be used for manager operation.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-12-21 19:10:16 +05:30 committed by mergify[bot]
parent 93e43d1a0f
commit 810e285c50

View File

@ -314,6 +314,9 @@ func createDummyImage(ctx context.Context, rbdVol *rbdVolume) error {
} }
dummyVol := *rbdVol dummyVol := *rbdVol
dummyVol.RbdImageName = imgName dummyVol.RbdImageName = imgName
// dummyVol holds rbdVol details, reset ImageID or else dummy image cannot be
// deleted from trash during repair operation.
dummyVol.ImageID = ""
f := []string{ f := []string{
librbd.FeatureNameLayering, librbd.FeatureNameLayering,
librbd.FeatureNameObjectMap, librbd.FeatureNameObjectMap,