e2e: seperate wait for termination notice and graceful termination

This commit is contained in:
Mike Danese
2016-03-09 15:01:55 -08:00
parent 36cb9d05ea
commit f8e1404f87
4 changed files with 92 additions and 69 deletions

View File

@@ -351,6 +351,28 @@ var _ = Describe("Pods", func() {
Failf("Failed to delete pod: %v", err)
}
By("verifying the kubelet observed the termination notice")
pod, err = podClient.Get(pod.Name)
Expect(wait.Poll(time.Second*5, time.Second*30, func() (bool, error) {
podList, err := GetKubeletPods(framework.Client, pod.Spec.NodeName)
if err != nil {
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 {
Logf("deletion has not yet been observed")
return false, nil
}
return true, nil
}
Logf("no pod exists with the name we were looking for, assuming the termination request was observed and completed")
return true, nil
})).NotTo(HaveOccurred(), "kubelet never observed the termination notice")
By("verifying pod deletion was observed")
deleted := false
timeout := false