mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
rbd: do deep copy for dummyVol struct
with shallow copy of rbdVol to dummyVol the image name update of the dummyVol is getting reflected on the rbdVol which we dont want. do deep copy to avoid this problem. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
5472b66ccf
commit
211ca9b5a7
@ -290,9 +290,9 @@ func createDummyImage(ctx context.Context, rbdVol *rbdVolume) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dummyVol := rbdVol
|
dummyVol := *rbdVol
|
||||||
dummyVol.RbdImageName = imgName
|
dummyVol.RbdImageName = imgName
|
||||||
err = createImage(ctx, dummyVol, dummyVol.conn.Creds)
|
err = createImage(ctx, &dummyVol, dummyVol.conn.Creds)
|
||||||
if err != nil && !strings.Contains(err.Error(), "File exists") {
|
if err != nil && !strings.Contains(err.Error(), "File exists") {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -310,7 +310,7 @@ func tickleMirroringOnDummyImage(rbdVol *rbdVolume, mirroringMode librbd.ImageMi
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
dummyVol := rbdVol
|
dummyVol := *rbdVol
|
||||||
dummyVol.RbdImageName = imgName
|
dummyVol.RbdImageName = imgName
|
||||||
|
|
||||||
dummyImageOpsLock.Lock()
|
dummyImageOpsLock.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user