mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Fix deployment timeout reporting
If the previous condition has been a successful rollout then we shouldn't try to estimate any progress. Scenario: * progressDeadlineSeconds is smaller than the difference between now and the time the last rollout finished in the past. * the creation of a new ReplicaSet triggers a resync of the Deployment prior to the cached copy of the Deployment getting updated with the status.condition that indicates the creation of the new ReplicaSet. The Deployment will be resynced and eventually its Progressing condition will catch up with the state of the world. Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
This commit is contained in:
@@ -861,6 +861,20 @@ func DeploymentTimedOut(deployment *extensions.Deployment, newStatus *extensions
|
||||
if condition == nil {
|
||||
return false
|
||||
}
|
||||
// If the previous condition has been a successful rollout then we shouldn't try to
|
||||
// estimate any progress. Scenario:
|
||||
//
|
||||
// * progressDeadlineSeconds is smaller than the difference between now and the time
|
||||
// the last rollout finished in the past.
|
||||
// * the creation of a new ReplicaSet triggers a resync of the Deployment prior to the
|
||||
// cached copy of the Deployment getting updated with the status.condition that indicates
|
||||
// the creation of the new ReplicaSet.
|
||||
//
|
||||
// The Deployment will be resynced and eventually its Progressing condition will catch
|
||||
// up with the state of the world.
|
||||
if condition.Reason == NewRSAvailableReason {
|
||||
return false
|
||||
}
|
||||
if condition.Reason == TimedOutReason {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user