From d0c0dcd2d669356363ed8282ffd1b34620ad414a Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 24 Jun 2024 18:37:33 +0200 Subject: [PATCH] [WIP] pass missing context to rbdImage.Destroy() --- internal/rbd/clone.go | 2 +- internal/rbd/controllerserver.go | 2 +- internal/rbd/rbd_util.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/rbd/clone.go b/internal/rbd/clone.go index f4f088a9c3f..d4312b01203 100644 --- a/internal/rbd/clone.go +++ b/internal/rbd/clone.go @@ -183,7 +183,7 @@ func (rv *rbdVolume) doSnapClone(ctx context.Context, parentVol *rbdVolume) erro // generate temp cloned volume tempClone := rv.generateTempClone() - defer tempClone.Destroy() + defer tempClone.Destroy(ctx) // snapshot name is same as temporary cloned image, This helps to // flatten the temporary cloned images as we cannot have more than 510 diff --git a/internal/rbd/controllerserver.go b/internal/rbd/controllerserver.go index 8c94dd38996..12f7d709ede 100644 --- a/internal/rbd/controllerserver.go +++ b/internal/rbd/controllerserver.go @@ -668,7 +668,7 @@ func (cs *ControllerServer) createVolumeFromSnapshot( parentVol := rbdSnap.toVolume() // as we are operating on single cluster reuse the connection parentVol.conn = rbdVol.conn.Copy() - defer parentVol.Destroy() + defer parentVol.Destroy(ctx) // create clone image and delete snapshot err = rbdVol.cloneRbdImageFromSnapshot(ctx, rbdSnap, parentVol) diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 58213b15ecf..ab3a89dda39 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -1666,7 +1666,7 @@ func (ri *rbdImage) flattenParent(ctx context.Context, hardLimit, softLimit uint if parentImage == nil { return nil } - defer parentImage.Destroy() + defer parentImage.Destroy(ctx) return parentImage.flattenRbdImage(ctx, false, hardLimit, softLimit) }