rbd: update snap RbdImageName in createSnapshot

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>
This commit is contained in:
Praveen M 2023-09-29 09:27:11 +05:30 committed by mergify[bot]
parent 9c53bf805b
commit 0ed7a64191
2 changed files with 1 additions and 2 deletions

View File

@ -1340,8 +1340,6 @@ 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 {
log.ErrorLog(ctx, "failed to create snapshot %s: %v", rbdSnap, err) log.ErrorLog(ctx, "failed to create snapshot %s: %v", rbdSnap, err)

View File

@ -1411,6 +1411,7 @@ func (ri *rbdImage) hasSnapshotFeature() bool {
} }
func (ri *rbdImage) createSnapshot(ctx context.Context, pOpts *rbdSnapshot) error { 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) log.DebugLog(ctx, "rbd: snap create %s using mon %s", pOpts, pOpts.Monitors)
image, err := ri.open() image, err := ri.open()
if err != nil { if err != nil {