Skip to content

Commit

Permalink
rbd: update snap RbdImageName in createSnapshot
Browse files Browse the repository at this point in the history
This PR updates the snapshot RbdImageName in
`createSnapshot` method. This resolves the
incorrect statement logged during snapshot creation.

Signed-off-by: Praveen M <m.praveen@ibm.com>
  • Loading branch information
iPraveenParihar authored and nixpanic committed Oct 2, 2023
1 parent fd1dbfe commit bbcd92b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,6 @@ func (cs *ControllerServer) doSnapshotClone(
return nil, err
}

// update rbd image name
rbdSnap.RbdImageName = cloneRbd.RbdImageName
err = cloneRbd.createSnapshot(ctx, rbdSnap)
if err != nil {
log.ErrorLog(ctx, "failed to create snapshot %s: %v", rbdSnap, err)
Expand Down
1 change: 1 addition & 0 deletions internal/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ func (ri *rbdImage) hasSnapshotFeature() bool {
}

func (ri *rbdImage) createSnapshot(ctx context.Context, pOpts *rbdSnapshot) error {
pOpts.RbdImageName = ri.RbdImageName
log.DebugLog(ctx, "rbd: snap create %s using mon %s", pOpts, pOpts.Monitors)
image, err := ri.open()
if err != nil {
Expand Down

0 comments on commit bbcd92b

Please sign in to comment.