mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #94922 from knabben/pre-stop-e2e
Verify pod termination with E2E PreStop hook
This commit is contained in:
commit
1ec3345eb6
@ -187,10 +187,11 @@ var _ = SIGDescribe("PreStop", func() {
|
|||||||
err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(gracefulTerminationPeriodSeconds))
|
err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(gracefulTerminationPeriodSeconds))
|
||||||
framework.ExpectNoError(err, "failed to delete pod")
|
framework.ExpectNoError(err, "failed to delete pod")
|
||||||
|
|
||||||
//wait up to graceful termination period seconds
|
// wait for less than the gracePeriod termination ensuring the
|
||||||
time.Sleep(30 * time.Second)
|
// preStop hook is still executing.
|
||||||
|
time.Sleep(15 * time.Second)
|
||||||
|
|
||||||
ginkgo.By("verifying the pod running state after graceful termination")
|
ginkgo.By("verifying the pod is running while in the graceful period termination")
|
||||||
result := &v1.PodList{}
|
result := &v1.PodList{}
|
||||||
err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) {
|
err = wait.Poll(time.Second*5, time.Second*60, func() (bool, error) {
|
||||||
client, err := e2ekubelet.ProxyRequest(f.ClientSet, pod.Spec.NodeName, "pods", ports.KubeletPort)
|
client, err := e2ekubelet.ProxyRequest(f.ClientSet, pod.Spec.NodeName, "pods", ports.KubeletPort)
|
||||||
|
Loading…
Reference in New Issue
Block a user