mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #88798 from k-toyoda-pi/update_e2e_for_pdb
Improve waitForPDBCollectionToBeDeleted in e2e test
This commit is contained in:
commit
a480f07b99
@ -431,15 +431,17 @@ func deletePDBCollection(cs kubernetes.Interface, ns string) {
|
||||
|
||||
func waitForPDBCollectionToBeDeleted(cs kubernetes.Interface, ns string) {
|
||||
ginkgo.By("Waiting for the PDB collection to be deleted")
|
||||
wait.PollImmediate(framework.Poll, schedulingTimeout, func() (bool, error) {
|
||||
err := wait.PollImmediate(framework.Poll, schedulingTimeout, func() (bool, error) {
|
||||
pdbList, err := cs.PolicyV1beta1().PodDisruptionBudgets(ns).List(context.TODO(), metav1.ListOptions{})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
framework.ExpectNoError(err, "Listing PDB set in namespace %s", ns)
|
||||
framework.ExpectEqual(len(pdbList.Items), 0, "Expecting No PDBs returned in namespace %s", ns)
|
||||
if len(pdbList.Items) != 0 {
|
||||
return false, nil
|
||||
}
|
||||
return true, nil
|
||||
})
|
||||
framework.ExpectNoError(err, "Waiting for the PDB collection to be deleted in namespace %s", ns)
|
||||
}
|
||||
|
||||
func createPodsOrDie(cs kubernetes.Interface, ns string, n int) {
|
||||
|
Loading…
Reference in New Issue
Block a user