mirror of https://github.com/ceph/go-ceph
rbd: in TestRemoveImage ensure options are destroyed
The resources of the rbd image options must be cleaned up or we leak. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
fc29c7f30a
commit
1842bd74e6
|
@ -1332,7 +1332,9 @@ func TestRemoveImage(t *testing.T) {
|
||||||
|
|
||||||
// create and then remove an image
|
// create and then remove an image
|
||||||
name := GetUUID()
|
name := GetUUID()
|
||||||
err = CreateImage(ioctx, name, testImageSize, NewRbdImageOptions())
|
options := NewRbdImageOptions()
|
||||||
|
defer options.Destroy()
|
||||||
|
err = CreateImage(ioctx, name, testImageSize, options)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
imageNames, err := GetImageNames(ioctx)
|
imageNames, err := GetImageNames(ioctx)
|
||||||
|
|
Loading…
Reference in New Issue