Skip to content

Commit a52b909

Browse files
committed
Avoid panic if creating volume from source fails
If a driver advertises CREATE_DELETE_SNAPSHOT but fails to obey the part of the spec about allowing CreateVolume from a snapshot (such as during an incremental development of a driver), the testsuite was panicking on a nil dereference instead of diagnosing that an unexpected error was returned. Fixes: #569 Signed-off-by: Eric Blake <[email protected]>
1 parent 70e0e18 commit a52b909

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: pkg/sanity/controller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,9 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
581581
},
582582
}
583583
vol, err := r.CreateVolume(context.Background(), vol2Req)
584-
Expect(vol.GetVolume().ContentSource).NotTo(BeNil())
585584
Expect(err).NotTo(HaveOccurred())
585+
Expect(vol).NotTo(BeNil())
586+
Expect(vol.GetVolume().ContentSource).NotTo(BeNil())
586587
})
587588

588589
It("should fail when the volume source snapshot is not found", func() {

0 commit comments

Comments
 (0)