Commit 952e6c64 authored by Tomas Nozicka's avatar Tomas Nozicka

Fix Deployment with Recreate strategy not to wait on Pods in terminal phase

parent 82eeda08
...@@ -104,8 +104,19 @@ func oldPodsRunning(newRS *extensions.ReplicaSet, oldRSs []*extensions.ReplicaSe ...@@ -104,8 +104,19 @@ func oldPodsRunning(newRS *extensions.ReplicaSet, oldRSs []*extensions.ReplicaSe
if newRS != nil && newRS.UID == rsUID { if newRS != nil && newRS.UID == rsUID {
continue continue
} }
if len(podList.Items) > 0 { for _, pod := range podList.Items {
return true switch pod.Status.Phase {
case v1.PodFailed, v1.PodSucceeded:
// Don't count pods in terminal state.
continue
case v1.PodUnknown:
// This happens in situation like when the node is temporarily disconnected from the cluster.
// If we can't be sure that the pod is not running, we have to count it.
return true
default:
// Pod is not in terminal phase.
return true
}
} }
} }
return false return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment