Skip to content

Commit f7d3f3e

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

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+
err = wait.Poll(pollInterval, pollDuration, 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+
ctx.Ctx().Logf("Error: getting catalog source pod: %s", err)
517+
return false, err
518+
}
519+
if len(fetched.Items) == 0 {
520+
return true, nil
521+
}
522+
return false, nil
523+
})
512524
}
513525
}
514526

0 commit comments

Comments
 (0)