Skip to content

Commit 739a61a

Browse files
authored
Merge pull request kubernetes#91221 from gnufied/tolerate-pod-not-found
Tolerate pod not found errors in storage e2e
2 parents bb4a211 + 155db11 commit 739a61a

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)