Skip to content

Commit 73045dd

Browse files
committed
test: standardize catalogsource cleanup
Match the same catalog source cleanup logic as "Testing an all default operator policy" ref: https://issues.redhat.com/browse/ACM-26529 Signed-off-by: Janelle Law <[email protected]>
1 parent b4ba942 commit 73045dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/e2e/case38_install_operator_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,9 +1172,18 @@ var _ = Describe("Testing OperatorPolicy", Label("supports-hosted"), func() {
11721172

11731173
By("Applying creating a ns and the test policy")
11741174
preFunc()
1175-
DeferCleanup(func() {
1175+
DeferCleanup(func(ctx context.Context) {
1176+
By("Fixing the catalog source")
11761177
KubectlTarget("patch", "catalogsource", catSrcName, "-n", "olm", "--type=json", "-p",
11771178
`[{"op": "replace", "path": "/spec/image", "value": "quay.io/operatorhubio/catalog:latest"}]`)
1179+
1180+
By("Waiting for a packagemanifest to reappear")
1181+
Eventually(func() error {
1182+
_, err := targetK8sDynamic.Resource(gvrPackageManifest).Namespace("default").Get(
1183+
ctx, "project-quay", metav1.GetOptions{})
1184+
1185+
return err
1186+
}, olmWaitTimeout*2, 3).Should(Succeed())
11781187
})
11791188

11801189
setupPolicy(opPolYAML, opPolName, parentPolicyName)

0 commit comments

Comments
 (0)