From e0fc992501f16f48c31f9d09ec5f4cb5bdcdc2bd Mon Sep 17 00:00:00 2001 From: Amarnath Valluri Date: Thu, 10 Oct 2019 11:36:17 +0300 Subject: [PATCH] sanity: fix volume leakage Volume created by testcase is not adding to cleanup list, hence it results in volume leaking. This change fixes this issue. Took the opportunity to fix a typo in comment. --- pkg/sanity/controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/sanity/controller.go b/pkg/sanity/controller.go index 3d21f76e..49126dcc 100644 --- a/pkg/sanity/controller.go +++ b/pkg/sanity/controller.go @@ -263,7 +263,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *Sanity // minVolCount is the minimum number of volumes expected to exist, // based on which paginated volume listing is performed. minVolCount := 3 - // maxEntried is the maximum entries in list volume request. + // maxEntries is the maximum entries in list volume request. maxEntries := 2 // existing_vols to keep a record of the volumes that should exist existing_vols := map[string]bool{} @@ -358,6 +358,8 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *Sanity Expect(err).NotTo(HaveOccurred()) Expect(vol).NotTo(BeNil()) Expect(vol.Volume).NotTo(BeNil()) + // Register the volume so it's automatically cleaned + cl.RegisterVolume(vol.Volume.VolumeId, VolumeInfo{VolumeID: vol.Volume.VolumeId}) existing_vols[vol.Volume.VolumeId] = true vols, err = c.ListVolumes(