Skip to content

Commit

Permalink
Simplify logic and properly handle the case where the Service is not
Browse files Browse the repository at this point in the history
found during the delete call
  • Loading branch information
kimorris27 committed Jan 29, 2024
1 parent cb1e830 commit 6d3042d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/e2e/adminapi_delete_managedresource.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ var _ = Describe("[Admin API] Delete managed resource action", func() {
// wait for deletion to prevent flakes on retries
Eventually(func(g Gomega, ctx context.Context) {
err := clients.Kubernetes.CoreV1().Services("default").Delete(ctx, "test", metav1.DeleteOptions{})
Expect(err).NotTo(HaveOccurred())

_, err = clients.Kubernetes.CoreV1().Services("default").Get(ctx, "test", metav1.GetOptions{})
g.Expect(kerrors.IsNotFound(err)).To(BeTrue(), "expect Service to be deleted")
g.Expect((err == nil || kerrors.IsNotFound(err))).To(BeTrue(), "expect Service to be deleted")
}).WithContext(ctx).WithTimeout(DefaultEventuallyTimeout).Should(Succeed())
}()

Expand Down

0 comments on commit 6d3042d

Please sign in to comment.