Skip to content

Commit

Permalink
sanity: fix volume leakage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
avalluri committed Oct 10, 2019
1 parent 1d38cfa commit e0fc992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/sanity/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e0fc992

Please sign in to comment.