Skip to content

Commit e0fc992

Browse files
committed
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.
1 parent 1d38cfa commit e0fc992

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/sanity/controller.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *Sanity
263263
// minVolCount is the minimum number of volumes expected to exist,
264264
// based on which paginated volume listing is performed.
265265
minVolCount := 3
266-
// maxEntried is the maximum entries in list volume request.
266+
// maxEntries is the maximum entries in list volume request.
267267
maxEntries := 2
268268
// existing_vols to keep a record of the volumes that should exist
269269
existing_vols := map[string]bool{}
@@ -358,6 +358,8 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *Sanity
358358
Expect(err).NotTo(HaveOccurred())
359359
Expect(vol).NotTo(BeNil())
360360
Expect(vol.Volume).NotTo(BeNil())
361+
// Register the volume so it's automatically cleaned
362+
cl.RegisterVolume(vol.Volume.VolumeId, VolumeInfo{VolumeID: vol.Volume.VolumeId})
361363
existing_vols[vol.Volume.VolumeId] = true
362364

363365
vols, err = c.ListVolumes(

0 commit comments

Comments
 (0)