From 7b0f051fd458f2198b423e94c93ccc609827c38e Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Tue, 9 Nov 2021 17:18:29 +0530 Subject: [PATCH] rbd: remove redundant rbdVolume.connect() in flattenRbdImage() This commit removes `rv.Connect(cr)` since the rbdVolume should have an active connection in this stage of the function call. `rv.getCloneDepth(ctx)` will work after a connect to the cluster. Signed-off-by: Rakshith R --- internal/rbd/rbd_util.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index bb57cb020..452e111a9 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -871,10 +871,6 @@ func (rv *rbdVolume) flattenRbdImage( "task manager does not support flatten,image will be flattened once hardlimit is reached: %v", err) if forceFlatten || depth >= hardlimit { - err = rv.Connect(cr) - if err != nil { - return err - } err := rv.flatten() if err != nil { log.ErrorLog(ctx, "rbd failed to flatten image %s %s: %v", rv.Pool, rv.RbdImageName, err)