Skip to content

Commit 9fd1c3f

Browse files
wait for catalogsource pod deletion (#2444)
Signed-off-by: akihikokuroda <[email protected]>
1 parent 08ca061 commit 9fd1c3f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/e2e/util.go

+12
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,18 @@ func buildCatalogSourceCleanupFunc(crc versioned.Interface, namespace string, ca
505505
ctx.Ctx().Logf("Deleting catalog source %s...", catalogSource.GetName())
506506
err := crc.OperatorsV1alpha1().CatalogSources(namespace).Delete(context.Background(), catalogSource.GetName(), metav1.DeleteOptions{})
507507
Expect(err).ToNot(HaveOccurred())
508+
509+
Eventually(func() (bool, error) {
510+
fetched, err := newKubeClient().KubernetesInterface().CoreV1().Pods(catalogSource.GetNamespace()).List(context.Background(), metav1.ListOptions{LabelSelector: "olm.catalogSource=" + catalogSource.GetName()})
511+
if err != nil {
512+
return false, err
513+
}
514+
if len(fetched.Items) == 0 {
515+
return true, nil
516+
}
517+
ctx.Ctx().Logf("waiting for the catalog source %s pod to be deleted...", fetched.Items[0].GetName())
518+
return false, nil
519+
}).Should(BeTrue())
508520
}
509521
}
510522

0 commit comments

Comments
 (0)