Skip to content

Commit

Permalink
[WIP] pass missing context to rbdImage.Destroy()
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpanic committed Jun 25, 2024
1 parent 369b23b commit 5a507bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/rbd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/rbd/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5a507bf

Please sign in to comment.