Skip to content

Commit

Permalink
Updating ExpectDelete to ignore already deleted objects (#115)
Browse files Browse the repository at this point in the history
* Updating ExpectDeleted to ignore deleted objects

* Trigger Build
  • Loading branch information
sarthakkothari authored Dec 18, 2024
1 parent b8da2f3 commit a43b1f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/expectations/expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func ExpectStatusUpdated(ctx context.Context, c client.Client, objects ...client
func ExpectDeleted(ctx context.Context, c client.Client, objects ...client.Object) {
GinkgoHelper()
for _, o := range objects {
Expect(c.Delete(ctx, o)).To(Succeed())
Expect(c.Get(ctx, client.ObjectKeyFromObject(o), o)).To(Or(Succeed(), MatchError(ContainSubstring("not found"))))
Expect(client.IgnoreNotFound(c.Delete(ctx, o))).To(Succeed())
Expect(client.IgnoreNotFound(c.Get(ctx, client.ObjectKeyFromObject(o), o))).To(Succeed())
}
}

Expand Down

0 comments on commit a43b1f8

Please sign in to comment.