-
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
fix bug: allow optional filed maxunavilable to be nil in ads, and set default … #1007
fix bug: allow optional filed maxunavilable to be nil in ads, and set default … #1007
Conversation
Welcome @ABNER-1! It looks like this is your first PR to openkruise/kruise 🎉 |
9409636
to
83a4ffe
Compare
…value as 1 Signed-off-by: ABNER-1 <abner199709@gmail.com> Signed-off-by: yuanyuxing <yuanyuxing@bilibili.com>
83a4ffe
to
45c8ce2
Compare
@@ -254,7 +254,10 @@ func unavailableCount(ds *appsv1alpha1.DaemonSet, numberToSchedule int) (int, er | |||
} | |||
r := ds.Spec.UpdateStrategy.RollingUpdate | |||
if r == nil { | |||
return 0, nil | |||
return 1, nil |
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.
This should not be changed.
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.
I just refer to the implementation of max surge and return the default value of maxunavilable in the doc.
Sorry to change this because I did not read all codes in ds reconcile function.
return 1, nil | ||
} | ||
if r.MaxUnavailable == nil { | ||
return 1, nil |
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.
…mally Signed-off-by: yuanyuxing <yuanyuxing@bilibili.com>
Codecov Report
@@ Coverage Diff @@
## master #1007 +/- ##
==========================================
+ Coverage 49.10% 49.66% +0.56%
==========================================
Files 125 124 -1
Lines 12062 12090 +28
==========================================
+ Hits 5923 6005 +82
+ Misses 5235 5166 -69
- Partials 904 919 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
/lgtm
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FillZpp 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 |
… default … (openkruise#1007) * fix bug: allow optional filed max unavilable in ads, and set default value as 1 Signed-off-by: ABNER-1 <abner199709@gmail.com> Signed-off-by: yuanyuxing <yuanyuxing@bilibili.com> * return 0 when max unavailable is nil and make the validation work normally Signed-off-by: yuanyuxing <yuanyuxing@bilibili.com> Co-authored-by: yuanyuxing <yuanyuxing@bilibili.com> Signed-off-by: Liu Zhenwei <zwliu@thoughtworks.com>
… default … (openkruise#1007) * fix bug: allow optional filed max unavilable in ads, and set default value as 1 * return 0 when max unavailable is nil and make the validation work normally Co-authored-by: yuanyuxing <yuanyuxing@bilibili.com>
fix bug: allow optional filed max unavilable in ads, and set default value 1
Ⅰ. Describe what this PR does
Ⅱ. Does this pull request fix one issue?
fixes #1006
Ⅲ. Describe how to verify it
update ads with nil MaxUnavailable.
Ⅳ. Special notes for reviews