Skip to content

Commit 155db11

Browse files
committed
Do not fail test if pod is not found
1 parent 04deee9 commit 155db11

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/e2e/framework/pod/delete.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ const (
3535
PodDeleteTimeout = 5 * time.Minute
3636
)
3737

38-
// DeletePodOrFail deletes the pod of the specified namespace and name.
38+
// DeletePodOrFail deletes the pod of the specified namespace and name. Resilient to the pod
39+
// not existing.
3940
func DeletePodOrFail(c clientset.Interface, ns, name string) {
4041
ginkgo.By(fmt.Sprintf("Deleting pod %s in namespace %s", name, ns))
4142
err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{})
43+
if err != nil && apierrors.IsNotFound(err) {
44+
return
45+
}
46+
4247
expectNoError(err, "failed to delete pod %s in namespace %s", name, ns)
4348
}
4449

0 commit comments

Comments
 (0)