Skip to content

Commit 0fd6b2e

Browse files
committed
wait for catalogsource pod deletion
Signed-off-by: akihikokuroda <[email protected]>
1 parent 4cc28bb commit 0fd6b2e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/e2e/util_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,18 @@ func buildCatalogSourceCleanupFunc(crc versioned.Interface, namespace string, ca
509509
ctx.Ctx().Logf("Deleting catalog source %s...", catalogSource.GetName())
510510
err := crc.OperatorsV1alpha1().CatalogSources(namespace).Delete(context.Background(), catalogSource.GetName(), metav1.DeleteOptions{})
511511
Expect(err).ToNot(HaveOccurred())
512+
513+
Eventually(func() (bool, error) {
514+
fetched, err := newKubeClient().KubernetesInterface().CoreV1().Pods(catalogSource.GetNamespace()).List(context.Background(), metav1.ListOptions{LabelSelector: "olm.catalogSource=" + catalogSource.GetName()})
515+
if err != nil {
516+
return false, err
517+
}
518+
if len(fetched.Items) == 0 {
519+
return true, nil
520+
}
521+
ctx.Ctx().Logf("waiting for the catalog source %s pod to be deleted...", fetched.Items[0].GetName())
522+
return false, nil
523+
}).Should(BeTrue())
512524
}
513525
}
514526

0 commit comments

Comments
 (0)