Skip to content

Commit 66041d1

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 3ad33cb commit 66041d1

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
@@ -676,8 +676,9 @@ var _ = DescribeSanity("Controller Service [Controller Server]", func(sc *TestCo
676676
},
677677
}
678678
vol, err := r.CreateVolume(context.Background(), vol2Req)
679-
Expect(vol.GetVolume().ContentSource).NotTo(BeNil())
680679
Expect(err).NotTo(HaveOccurred())
680+
Expect(vol).NotTo(BeNil())
681+
Expect(vol.GetVolume().ContentSource).NotTo(BeNil())
681682
})
682683

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

0 commit comments

Comments
 (0)