Repository: knative/serving
Pull request #10302 (2020-12-08 01:27:33)

Copy the step size as well from the prev rollout to the current
/assign @tcnghia 

knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative/serving/pull/10302#" title="Author self-approved">vagababov</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fserving).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[pkg/reconciler/route/OWNERS](https://github.com/knative/serving/blob/master/pkg/reconciler/route/OWNERS)~~ [vagababov]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
codecov[bot]: # [Codecov](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=h1) Report
> Merging [#10302](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=desc) (b668545) into [master](https://codecov.io/gh/knative/serving/commit/3b581ac8d6937f0e4c0166f20c714a2a9b8ea94a?el=desc) (3b581ac) will **decrease** coverage by `0.02%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/knative/serving/pull/10302/graphs/tree.svg?width=650&height=150&src=pr&token=MPpDfAj4Ui)](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #10302      +/-   ##
==========================================
- Coverage   88.24%   88.21%   -0.03%     
==========================================
  Files         184      184              
  Lines        8649     8650       +1     
==========================================
- Hits         7632     7631       -1     
- Misses        783      784       +1     
- Partials      234      235       +1     
```


| [Impacted Files](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pkg/reconciler/route/traffic/rollout.go](https://codecov.io/gh/knative/serving/pull/10302/diff?src=pr&el=tree#diff-cGtnL3JlY29uY2lsZXIvcm91dGUvdHJhZmZpYy9yb2xsb3V0Lmdv) | `100.00% <100.00%> (ø)` | |
| [pkg/reconciler/configuration/configuration.go](https://codecov.io/gh/knative/serving/pull/10302/diff?src=pr&el=tree#diff-cGtnL3JlY29uY2lsZXIvY29uZmlndXJhdGlvbi9jb25maWd1cmF0aW9uLmdv) | `86.71% <0.00%> (-1.57%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=footer). Last update [3b581ac...b668545](https://codecov.io/gh/knative/serving/pull/10302?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative/serving/pull/10302#pullrequestreview-546686479" title="LGTM">tcnghia</a>*, *<a href="https://github.com/knative/serving/pull/10302#" title="Author self-approved">vagababov</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative%2Fserving).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[pkg/reconciler/route/OWNERS](https://github.com/knative/serving/blob/master/pkg/reconciler/route/OWNERS)~~ [tcnghia,vagababov]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/pkg/reconciler/route/traffic/rollout.go b/pkg/reconciler/route/traffic/rollout.go
index ec32014b4..9ded9dced 100644
--- a/pkg/reconciler/route/traffic/rollout.go
+++ b/pkg/reconciler/route/traffic/rollout.go
@@ -328,6 +328,7 @@ func stepConfig(goal, prev *ConfigurationRollout, nowTS int) *ConfigurationRollo
 			ret.NextStepTime = prev.NextStepTime
 			ret.StepDuration = prev.StepDuration
 			ret.StartTime = prev.StartTime
+			ret.StepSize = prev.StepSize
 			// adjustPercentage above would've already accounted if target for the
 			// whole Configuration changed up or down. So here we should just redistribute
 			// the existing values.


Test patch:
diff --git a/pkg/reconciler/route/traffic/rollout_test.go b/pkg/reconciler/route/traffic/rollout_test.go
index b79a4aa62..038951d75 100644
--- a/pkg/reconciler/route/traffic/rollout_test.go
+++ b/pkg/reconciler/route/traffic/rollout_test.go
@@ -82,6 +82,7 @@ func TestStep(t *testing.T) {
 				NextStepTime: 2009,
 				StepDuration: 2020,
 				StartTime:    2004,
+				StepSize:     14,
 			}},
 		},
 		prev: &Rollout{
@@ -96,6 +97,7 @@ func TestStep(t *testing.T) {
 				NextStepTime: 1984,
 				StepDuration: 1988,
 				StartTime:    1955,
+				StepSize:     15,
 			}},
 		},
 		want: &Rollout{
@@ -110,6 +112,7 @@ func TestStep(t *testing.T) {
 				NextStepTime: 1984,
 				StepDuration: 1988,
 				StartTime:    1955,
+				StepSize:     15,
 			}},
 		},
 	}, {