cleanup: release resources for rbdImages objects after use

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-04-07 09:55:00 +02:00 committed by mergify[bot]
parent dc990037a5
commit b5d0524c39

View File

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