diff --git a/e2e/deploy-vault.go b/e2e/deploy-vault.go index 6424f3c16..c896ef0fd 100644 --- a/e2e/deploy-vault.go +++ b/e2e/deploy-vault.go @@ -47,7 +47,7 @@ func deployVault(c kubernetes.Interface, deployTimeout int) { "cm", "ceph-csi-encryption-kms-config", "--ignore-not-found=true") - Expect(err).Should(BeNil()) + Expect(err).ShouldNot(HaveOccurred()) createORDeleteVault(kubectlCreate) opt := metav1.ListOptions{ @@ -55,11 +55,11 @@ func deployVault(c kubernetes.Interface, deployTimeout int) { } pods, err := c.CoreV1().Pods(cephCSINamespace).List(context.TODO(), opt) - Expect(err).Should(BeNil()) - Expect(len(pods.Items)).Should(Equal(1)) + Expect(err).ShouldNot(HaveOccurred()) + Expect(pods.Items).Should(HaveLen(1)) name := pods.Items[0].Name err = waitForPodInRunningState(name, cephCSINamespace, c, deployTimeout, noError) - Expect(err).Should(BeNil()) + Expect(err).ShouldNot(HaveOccurred()) } func deleteVault() { @@ -123,7 +123,7 @@ func createTenantServiceAccount(c kubernetes.Interface, ns string) error { // were created with createTenantServiceAccount. func deleteTenantServiceAccount(ns string) { err := createORDeleteTenantServiceAccount(kubectlDelete, ns) - Expect(err).Should(BeNil()) + Expect(err).ShouldNot(HaveOccurred()) } // createORDeleteTenantServiceAccount is a helper that reads the tenant-sa.yaml diff --git a/e2e/resize.go b/e2e/resize.go index e1df9f4a0..8f3b30219 100644 --- a/e2e/resize.go +++ b/e2e/resize.go @@ -45,7 +45,7 @@ func expandPVCSize(c kubernetes.Interface, pvc *v1.PersistentVolumeClaim, size s _, err = c.CoreV1(). PersistentVolumeClaims(updatedPVC.Namespace). Update(context.TODO(), updatedPVC, metav1.UpdateOptions{}) - Expect(err).Should(BeNil()) + Expect(err).ShouldNot(HaveOccurred()) start := time.Now() framework.Logf("Waiting up to %v to be in Resized state", pvc) diff --git a/e2e/snapshot.go b/e2e/snapshot.go index cde7c6bb3..0839513cc 100644 --- a/e2e/snapshot.go +++ b/e2e/snapshot.go @@ -35,7 +35,7 @@ import ( func getSnapshotClass(path string) snapapi.VolumeSnapshotClass { sc := snapapi.VolumeSnapshotClass{} err := unmarshal(path, &sc) - Expect(err).Should(BeNil()) + Expect(err).ShouldNot(HaveOccurred()) return sc } @@ -43,7 +43,7 @@ func getSnapshotClass(path string) snapapi.VolumeSnapshotClass { func getSnapshot(path string) snapapi.VolumeSnapshot { sc := snapapi.VolumeSnapshot{} err := unmarshal(path, &sc) - Expect(err).Should(BeNil()) + Expect(err).ShouldNot(HaveOccurred()) return sc }