Move deployment e2e test for hash label adoption to integration
This commit is contained in:
@@ -200,6 +200,12 @@ func (d *deploymentTester) waitForDeploymentRevisionAndImage(revision, image str
|
||||
return nil
|
||||
}
|
||||
|
||||
func markPodReady(c clientset.Interface, ns string, pod *v1.Pod) error {
|
||||
addPodConditionReady(pod, metav1.Now())
|
||||
_, err := c.Core().Pods(ns).UpdateStatus(pod)
|
||||
return err
|
||||
}
|
||||
|
||||
// markAllPodsReady manually updates all Deployment pods status to ready
|
||||
func (d *deploymentTester) markAllPodsReady() {
|
||||
ns := d.deployment.Namespace
|
||||
@@ -215,14 +221,17 @@ func (d *deploymentTester) markAllPodsReady() {
|
||||
d.t.Logf("failed to list Deployment pods, will retry later: %v", err)
|
||||
return false, nil
|
||||
}
|
||||
if len(pods.Items) != int(*d.deployment.Spec.Replicas) {
|
||||
d.t.Logf("%d/%d of deployment pods are created", len(pods.Items), *d.deployment.Spec.Replicas)
|
||||
return false, nil
|
||||
}
|
||||
for i := range pods.Items {
|
||||
pod := pods.Items[i]
|
||||
if podutil.IsPodReady(&pod) {
|
||||
readyPods++
|
||||
continue
|
||||
}
|
||||
addPodConditionReady(&pod, metav1.Now())
|
||||
if _, err = d.c.Core().Pods(ns).UpdateStatus(&pod); err != nil {
|
||||
if err = markPodReady(d.c, ns, &pod); err != nil {
|
||||
d.t.Logf("failed to update Deployment pod %s, will retry later: %v", pod.Name, err)
|
||||
} else {
|
||||
readyPods++
|
||||
|
Reference in New Issue
Block a user