Skip to content

Commit

Permalink
Add an eventually in the CRD deletion case
Browse files Browse the repository at this point in the history
Signed-off-by: mprahl <mprahl@users.noreply.github.com>
  • Loading branch information
mprahl committed Jan 11, 2023
1 parent 1ecf245 commit 2b8c969
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/e2e/case20_delete_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,12 @@ var _ = Describe("Test objects are not deleted when the CRD is removed", Ordered
utils.Kubectl("delete", "-f", case20ConfigPolicyCRDPath)

By("Checking that the ConfigurationPolicy is gone")
namespace := clientManagedDynamic.Resource(gvrConfigPolicy).Namespace(testNamespace)
_, err := namespace.Get(context.TODO(), case20ConfigPolicyNameMHPDA, metav1.GetOptions{})
Expect(err).NotTo(BeNil())
Expect(err.Error()).To(ContainSubstring("the server could not find the requested resource"))
Eventually(func(g Gomega) {
namespace := clientManagedDynamic.Resource(gvrConfigPolicy).Namespace(testNamespace)
_, err := namespace.Get(context.TODO(), case20ConfigPolicyNameMHPDA, metav1.GetOptions{})
g.Expect(err).NotTo(BeNil())
g.Expect(err.Error()).To(ContainSubstring("the server could not find the requested resource"))
}, defaultTimeoutSeconds, 1).Should(Succeed())

By("Recreating the CRD")
utils.Kubectl("apply", "-f", case20ConfigPolicyCRDPath)
Expand Down

0 comments on commit 2b8c969

Please sign in to comment.