cleanup: pass context to rbdImage.Destroy()

In the future we'll introduce a more standard interface for objects like
Volumes and Snapshots. It is useful to have the context passed as 1st
argument to all functions of those objects, including their Destroy()
function.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos
2024-03-21 15:01:56 +01:00
committed by mergify[bot]
parent d5849a4801
commit 3aece2f38e
8 changed files with 37 additions and 37 deletions

View File

@ -46,10 +46,10 @@ import (
func (rv *rbdVolume) checkCloneImage(ctx context.Context, parentVol *rbdVolume) (bool, error) {
// generate temp cloned volume
tempClone := rv.generateTempClone()
defer tempClone.Destroy()
defer tempClone.Destroy(ctx)
snap := &rbdSnapshot{}
defer snap.Destroy()
defer snap.Destroy(ctx)
snap.RbdSnapName = rv.RbdImageName
snap.Pool = rv.Pool
@ -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