SPLAT-2238: Redesign logic to handle 4 pools with 3 max vcenters - #68
Conversation
|
@vr4manta: This pull request references SPLAT-2238 which is a valid jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vr4manta The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 31 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughThe vCenter exclusion algorithm in lease reconciliation is replaced with a hybrid strategy: it determines the minimum number of top-ranked vCenters needed by cumulative pool count to satisfy required pools, keeps those, and excludes remaining vCenters below a computed ceiling threshold. Tests are updated to match, adding a new scenario. ChangesHybrid vCenter exclusion algorithm
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/controller/leases_test.go`:
- Around line 1677-1683: Update the stale-table expectation in leases_test to
match the new threshold behavior: for the scenario with requiredPools=3,
vcentersLimit=2, and counts 2,2,1, the logic in the vcenter exclusion branch now
marks the 1-pool vCenter as excluded. Adjust the affected test case near the
existing table-driven expectations so it asserts that the single-pool server is
excluded instead of expecting no exclusions, using the same symbols and setup
used by the lease simulator test helpers.
In `@pkg/controller/leases.go`:
- Line 859: The ceiling calculation in the leases controller can overflow when
adding large user-supplied values; update the logic in the lease handling path
that computes ceiling from requiredPools and lease.Spec.VCenters to use the
safer equivalent form `(requiredPools-1)/lease.Spec.VCenters + 1`, and mirror
the same change in the corresponding expectation in leases tests so the
controller behavior and test remain aligned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c1a6b197-126b-4e34-85af-bc8693609d7f
📒 Files selected for processing (2)
pkg/controller/leases.gopkg/controller/leases_test.go
|
/lgtm |
SPLAT-2238
Changes
Summary by CodeRabbit