fix(poolautoscaler): reject when policy cannot reach min replicas - #931
fix(poolautoscaler): reject when policy cannot reach min replicas#931ywExcellent wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #931 +/- ##
==========================================
+ Coverage 82.68% 83.07% +0.39%
==========================================
Files 256 259 +3
Lines 21775 22592 +817
==========================================
+ Hits 18005 18769 +764
- Misses 3071 3106 +35
- Partials 699 717 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
80ffe35 to
d777375
Compare
d777375 to
bbeb790
Compare
When targetAvailable is set to 100% and all replicas are available, the pool is in a dead zone where no scale-down can ever occur. Add validation to reject this unreachable configuration at webhook level. Signed-off-by: 少师 <zengyuwei.zyw@alibaba-inc.com>
bbeb790 to
30e323c
Compare
Ⅰ. Describe what this PR does
Rejects (HTTP 422) PoolAutoscaler capacity policies that cannot scale an idle pool down to
minReplicas, instead of only returning an admission warning that users may never see.The check evaluates the upper watermark at
minReplicas + 1replicas with the same rounding and default-tolerance semantics as the controller, so validation matches runtime behavior.The error message explains the final scale-down step concretely instead of exposing the percentage formula:
Also updates the proposal with the plain-language rule, the equivalent formulas, and accepted/rejected configuration examples.
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Describe how to verify it
go test -mod=readonly ./pkg/webhook/poolautoscaler/validating -count=1targetAvailable: "100%"/"99%"withminReplicas: 1are rejected with 422.targetAvailable: "40%"(default tolerance) withminReplicas: 1is accepted.targetAvailable: 1withtolerance: 0is accepted.Ⅳ. Special notes for reviews
failurePolicy=fail). Existing PoolAutoscalers with such policies must be corrected before their next update.10%), keeping validation and runtime consistent.