mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Do not fail test if pod is not found
This commit is contained in:
parent
04deee94a8
commit
155db11b73
@ -35,10 +35,15 @@ const (
|
||||
PodDeleteTimeout = 5 * time.Minute
|
||||
)
|
||||
|
||||
// DeletePodOrFail deletes the pod of the specified namespace and name.
|
||||
// DeletePodOrFail deletes the pod of the specified namespace and name. Resilient to the pod
|
||||
// not existing.
|
||||
func DeletePodOrFail(c clientset.Interface, ns, name string) {
|
||||
ginkgo.By(fmt.Sprintf("Deleting pod %s in namespace %s", name, ns))
|
||||
err := c.CoreV1().Pods(ns).Delete(context.TODO(), name, metav1.DeleteOptions{})
|
||||
if err != nil && apierrors.IsNotFound(err) {
|
||||
return
|
||||
}
|
||||
|
||||
expectNoError(err, "failed to delete pod %s in namespace %s", name, ns)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user