From b146aa720c5f536a6a46e600ff49cfcc921ac512 Mon Sep 17 00:00:00 2001 From: Praveen M Date: Wed, 27 Sep 2023 15:39:11 +0530 Subject: [PATCH] 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 --- internal/rbd/controllerserver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index e632518fec49..bef86388e128 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -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