-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat]: Make sure at least one pod is upgraded if CloneSet Partition != 100% #954
Conversation
a317e38
to
6242d35
Compare
Codecov Report
@@ Coverage Diff @@
## master #954 +/- ##
==========================================
+ Coverage 49.96% 49.97% +0.01%
==========================================
Files 119 119
Lines 11535 11551 +16
==========================================
+ Hits 5763 5773 +10
- Misses 4898 4902 +4
- Partials 874 876 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
40c1f59
to
328cb5c
Compare
this patch should also fix #926 |
c871885
to
a953c9f
Compare
@@ -101,4 +102,12 @@ func (r *realStatusUpdater) calculateStatus(cs *appsv1alpha1.CloneSet, newStatus | |||
if newStatus.UpdatedReplicas == newStatus.Replicas { | |||
newStatus.CurrentRevision = newStatus.UpdateRevision | |||
} | |||
|
|||
if newStatus.UpdateRevision == newStatus.CurrentRevision { | |||
newStatus.ExpectedUpdatedReplicas = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if UpdateRevision= CurrentRevision, ExpectedUpdatedReplicas=replicas sounds more reasonable to me
@@ -466,6 +466,43 @@ func TestCalculateDiffsWithExpectation(t *testing.T) { | |||
}, | |||
expectResult: expectationDiffs{}, | |||
}, | |||
{ | |||
name: "update recreate partition=99% with maxSurge=2 (step 1/3)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plz consider add cases for percentage type maxUnavailable?
a953c9f
to
84497d6
Compare
Signed-off-by: veophi <vec.g.sun@gmail.com>
84497d6
to
84e5e9d
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: furykerry The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…penkruise#954) Signed-off-by: veophi <vec.g.sun@gmail.com> Signed-off-by: Liu Zhenwei <zwliu@thoughtworks.com>
Signed-off-by: veophi vec.g.sun@gmail.com
Ⅰ. Describe what this PR does
Make sure at least one pod is upgraded if CloneSet Partition != 100%:
replicas >= 2 && partition != 100%
, at least ONE pod will be upgraded;replicas >= 1
&& partition != 0%, at least ONE pod will keep old revision (same behaviors as before);Ⅱ. Does this pull request fix one issue?
fixes #953
fixes #926