Skip to content

Commit

Permalink
Merge pull request kubevirt#8628 from zhlhahaha/2687-2
Browse files Browse the repository at this point in the history
tests: fix nil point error for kubeClient
  • Loading branch information
kubevirt-bot authored Oct 28, 2022
2 parents 6391503 + 6a8be64 commit 333c4d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/virtctl/imageupload/imageupload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,14 @@ var _ = Describe("ImageUpload", func() {
})

It("Upload fails when using a nonexistent storageClass", func() {
testInit(http.StatusInternalServerError)
invalidStorageClass := "no-sc"
kubeClient.Fake.PrependReactor("get", "storageclasses", func(action testing.Action) (bool, runtime.Object, error) {
_, ok := action.(testing.GetAction)
Expect(ok).To(BeTrue())
return false, nil, nil
})

testInit(http.StatusInternalServerError)
cmd := clientcmd.NewRepeatableVirtctlCommand(commandName, "dv", targetName, "--size", pvcSize,
"--uploadproxy-url", server.URL, "--insecure", "--image-path", imagePath, "--storage-class", invalidStorageClass)
Expect(cmd()).NotTo(Succeed())
Expand Down

0 comments on commit 333c4d2

Please sign in to comment.