mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
e2e storage: wait for pod deletion
After deleting a pod, we need to be sure that it really is gone, otherwise there is a race condition: if we remove the CSI driver that is responsible for the volume used by the pod before the pod is actually deleted, deleting the pod will fail.
This commit is contained in:
parent
7d2ad805a9
commit
cead39cc97
@ -588,7 +588,8 @@ func StartInPodWithVolume(c clientset.Interface, ns, claimName, podName, command
|
||||
return pod
|
||||
}
|
||||
|
||||
// StopPod first tries to log the output of the pod's container, then deletes the pod.
|
||||
// StopPod first tries to log the output of the pod's container, then deletes the pod and
|
||||
// waits for that to succeed.
|
||||
func StopPod(c clientset.Interface, pod *v1.Pod) {
|
||||
if pod == nil {
|
||||
return
|
||||
@ -600,6 +601,7 @@ func StopPod(c clientset.Interface, pod *v1.Pod) {
|
||||
e2elog.Logf("Pod %s has the following logs: %s", pod.Name, body)
|
||||
}
|
||||
e2epod.DeletePodOrFail(c, pod.Namespace, pod.Name)
|
||||
e2epod.WaitForPodNoLongerRunningInNamespace(c, pod.Name, pod.Namespace)
|
||||
}
|
||||
|
||||
func verifyPVCsPending(client clientset.Interface, pvcs []*v1.PersistentVolumeClaim) {
|
||||
|
Loading…
Reference in New Issue
Block a user