mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Fix Deployment with Recreate strategy not to wait on Pods in terminal phase
This commit is contained in:
parent
82eeda0885
commit
952e6c64b6
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user