-
Notifications
You must be signed in to change notification settings - Fork 58
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
ignore 0 replica check #439
base: main
Are you sure you want to change the base?
Conversation
|
Hi @congcongke. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-lws canceled.
|
/ok-to-test |
@@ -165,7 +165,7 @@ func (r *LeaderWorkerSetWebhook) generalValidate(obj runtime.Object) field.Error | |||
if err != nil { | |||
allErrs = append(allErrs, field.Invalid(maxSurgePath, maxSurge, "invalid value")) | |||
} | |||
if maxUnavailableValue == 0 && maxSurgeValue == 0 { | |||
if maxUnavailableValue == 0 && maxSurgeValue == 0 && *lws.Spec.Replicas != 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.
I think it's not related between the scaling-to-zero and rolling update configuration. What you mean here is once replicas == 0, the maxUnavailable and maxSurgeValue could both be zero, however, it's not.
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.
Let's consider the case: replica = 0, maxUnavailable = 25% and maxSurge = 20%.
Then maxUnavailableValue will be 0 and maxSurge will be 0 as the calculated as above. Then admission webhook forbid this operation.
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.
Sorry, I forgot the value is calculated from the replicas. Let's add a webhook test to make sure it works with replicas==0.
/lgtm |
I tried to authorized the app. It failed always. By the way, I think you can make a same change and close this one. |
Hi @congcongke I can help you with this if you want to contribute this PR. Maybe you can follow the doc: https://github.com/kubernetes/community/blob/master/CLA.md |
Yeah, thank you so much! |
Could you add a test? #439 (comment) |
Signed-off-by: zhanweidu <[email protected]>
New changes are detected. LGTM label has been removed. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: congcongke The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sorry, forgot it. |
What type of PR is this?
/kind bug
What this PR does / why we need it
Scale to 0 is not worked when rolling update is enabled. Skip the related check should be considered.
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?