mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-28 13:03:43 +00:00
e2e: don't use kubelet api to verify pod deletion
Conformance tests must not rely on the kubelet API in order to pass. In this case, I think it's unnecessary to verify that a kubelet observes the deletion within gracePeriod seconds. The remaining checks in this test verify that pod deletion happens, and that the pod is removed.
This commit is contained in:
parent
cc7c862ce1
commit
1a5f6906e0
@ -71,7 +71,6 @@ go_library(
|
||||
"//staging/src/k8s.io/client-go/tools/watch:go_default_library",
|
||||
"//test/e2e/framework:go_default_library",
|
||||
"//test/e2e/framework/events:go_default_library",
|
||||
"//test/e2e/framework/kubelet:go_default_library",
|
||||
"//test/e2e/framework/network:go_default_library",
|
||||
"//test/e2e/framework/node:go_default_library",
|
||||
"//test/e2e/framework/pod:go_default_library",
|
||||
|
@ -42,7 +42,6 @@ import (
|
||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||
"k8s.io/kubernetes/pkg/kubelet"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2ekubelet "k8s.io/kubernetes/test/e2e/framework/kubelet"
|
||||
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
|
||||
e2ewebsocket "k8s.io/kubernetes/test/e2e/framework/websocket"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
@ -301,28 +300,6 @@ var _ = framework.KubeDescribe("Pods", func() {
|
||||
err = podClient.Delete(context.TODO(), pod.Name, *metav1.NewDeleteOptions(30))
|
||||
framework.ExpectNoError(err, "failed to delete pod")
|
||||
|
||||
ginkgo.By("verifying the kubelet observed the termination notice")
|
||||
err = wait.Poll(time.Second*5, time.Second*30, func() (bool, error) {
|
||||
podList, err := e2ekubelet.GetKubeletPods(f.ClientSet, pod.Spec.NodeName)
|
||||
if err != nil {
|
||||
framework.Logf("Unable to retrieve kubelet pods for node %v: %v", pod.Spec.NodeName, err)
|
||||
return false, nil
|
||||
}
|
||||
for _, kubeletPod := range podList.Items {
|
||||
if pod.Name != kubeletPod.Name {
|
||||
continue
|
||||
}
|
||||
if kubeletPod.ObjectMeta.DeletionTimestamp == nil {
|
||||
framework.Logf("deletion has not yet been observed")
|
||||
return false, nil
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
framework.Logf("no pod exists with the name we were looking for, assuming the termination request was observed and completed")
|
||||
return true, nil
|
||||
})
|
||||
framework.ExpectNoError(err, "kubelet never observed the termination notice")
|
||||
|
||||
ginkgo.By("verifying pod deletion was observed")
|
||||
deleted := false
|
||||
var lastPod *v1.Pod
|
||||
|
Loading…
Reference in New Issue
Block a user