From 2972538f5b2e2c6b24d90c53f32f5d7159ebe85f Mon Sep 17 00:00:00 2001 From: Michail Kargakis Date: Tue, 8 Nov 2016 11:41:53 +0100 Subject: [PATCH] Use the correct time field to estimate progress in deployments --- pkg/controller/deployment/util/deployment_util.go | 2 +- pkg/controller/deployment/util/deployment_util_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controller/deployment/util/deployment_util.go b/pkg/controller/deployment/util/deployment_util.go index 6a1a70c0e88..b520eda5835 100644 --- a/pkg/controller/deployment/util/deployment_util.go +++ b/pkg/controller/deployment/util/deployment_util.go @@ -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()) } diff --git a/pkg/controller/deployment/util/deployment_util_test.go b/pkg/controller/deployment/util/deployment_util_test.go index 96fb29431a4..722b12914de 100644 --- a/pkg/controller/deployment/util/deployment_util_test.go +++ b/pkg/controller/deployment/util/deployment_util_test.go @@ -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}, }, }, },