Merge pull request #50989 from wgliang/master

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:

should use time.Since instead of time.Now().Sub

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
NONE
**Special notes for your reviewer**:
NONE
**Release note**:

```release-note
```
NONE
This commit is contained in:
Kubernetes Submit Queue 2017-09-23 00:24:35 -07:00 committed by GitHub
commit ec382f3511
3 changed files with 3 additions and 3 deletions

View File

@ -560,7 +560,7 @@ func (dc *DeploymentController) syncDeployment(key string) error {
startTime := time.Now()
glog.V(4).Infof("Started syncing deployment %q (%v)", key, startTime)
defer func() {
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Now().Sub(startTime))
glog.V(4).Infof("Finished syncing deployment %q (%v)", key, time.Since(startTime))
}()
namespace, name, err := cache.SplitMetaNamespaceKey(key)

View File

@ -131,7 +131,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaler scalability [Slow]", fun
}
break
}
glog.Infof("Made nodes schedulable again in %v", time.Now().Sub(s).String())
glog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
})
It("should scale up at all [Feature:ClusterAutoscalerScalability1]", func() {

View File

@ -144,7 +144,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
}
break
}
glog.Infof("Made nodes schedulable again in %v", time.Now().Sub(s).String())
glog.Infof("Made nodes schedulable again in %v", time.Since(s).String())
})
It("shouldn't increase cluster size if pending pod is too large [Feature:ClusterSizeAutoscalingScaleUp]", func() {