rbd: update snap RbdImageName

This commit updates the snapshot RbdImageName with the clone
RbdImageName before snapshot creation. This will fix the
incorrect log statement.

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M 2023-09-27 15:39:11 +05:30 committed by mergify[bot]
parent 0c617b05d6
commit e504987984

View File

@ -1340,10 +1340,10 @@ func (cs *ControllerServer) doSnapshotClone(
return nil, err return nil, err
} }
// update rbd image name
rbdSnap.RbdImageName = cloneRbd.RbdImageName
err = cloneRbd.createSnapshot(ctx, rbdSnap) err = cloneRbd.createSnapshot(ctx, rbdSnap)
if err != nil { if err != nil {
// update rbd image name for logging
rbdSnap.RbdImageName = cloneRbd.RbdImageName
log.ErrorLog(ctx, "failed to create snapshot %s: %v", rbdSnap, err) log.ErrorLog(ctx, "failed to create snapshot %s: %v", rbdSnap, err)
return cloneRbd, err return cloneRbd, err