mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-17 20:00:23 +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 {
|
||||
return err
|
||||
}
|
||||
dummyVol := rbdVol
|
||||
dummyVol := *rbdVol
|
||||
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") {
|
||||
return err
|
||||
}
|
||||
@ -310,7 +310,7 @@ func tickleMirroringOnDummyImage(rbdVol *rbdVolume, mirroringMode librbd.ImageMi
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
dummyVol := rbdVol
|
||||
dummyVol := *rbdVol
|
||||
dummyVol.RbdImageName = imgName
|
||||
|
||||
dummyImageOpsLock.Lock()
|
||||
|
Loading…
Reference in New Issue
Block a user