Skip to content

Commit

Permalink
rbd: update snap RbdImageName
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
iPraveenParihar authored and mergify[bot] committed Sep 28, 2023
1 parent 0c617b0 commit e504987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1340,10 +1340,10 @@ func (cs *ControllerServer) doSnapshotClone(
return nil, err
}

// update rbd image name
rbdSnap.RbdImageName = cloneRbd.RbdImageName
err = cloneRbd.createSnapshot(ctx, rbdSnap)
if err != nil {
// update rbd image name for logging
rbdSnap.RbdImageName = cloneRbd.RbdImageName
log.ErrorLog(ctx, "failed to create snapshot %s: %v", rbdSnap, err)

return cloneRbd, err
Expand Down

0 comments on commit e504987

Please sign in to comment.