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 <[email protected]>
  • Loading branch information
iPraveenParihar committed Sep 27, 2023
1 parent 3bbd20a commit b146aa7
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 b146aa7

Please sign in to comment.