Use the correct time field to estimate progress in deployments

This commit is contained in:
Michail Kargakis 2016-11-08 11:41:53 +01:00
parent d2aabc8509
commit 2972538f5b
2 changed files with 4 additions and 4 deletions

View File

@ -844,7 +844,7 @@ func DeploymentTimedOut(deployment *extensions.Deployment, newStatus *extensions
// Look at the difference in seconds between now and the last time we reported any
// progress or tried to create a replica set, or resumed a paused deployment and
// compare against progressDeadlineSeconds.
from := condition.LastTransitionTime
from := condition.LastUpdateTime
delta := time.Duration(*deployment.Spec.ProgressDeadlineSeconds) * time.Second
return from.Add(delta).Before(nowFn())
}

View File

@ -1055,9 +1055,9 @@ func TestDeploymentTimedOut(t *testing.T) {
Status: extensions.DeploymentStatus{
Conditions: []extensions.DeploymentCondition{
{
Type: condType,
Status: status,
LastTransitionTime: unversioned.Time{Time: from},
Type: condType,
Status: status,
LastUpdateTime: unversioned.Time{Time: from},
},
},
},