karmada
karmada copied to clipboard
Fixes incorrect resource model selection
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer: Found this issue during the review of documents at https://github.com/karmada-io/website/pull/713#issuecomment-2414368554 by @LavredisG.
Given the resource model:
resourceModels:
- grade: 0
ranges:
- max: "1"
min: "0"
name: cpu
- grade: 1
ranges:
- max: "2"
min: "1"
name: cpu
- grade: 2
ranges:
- max: "4"
min: "2"
name: cpu
If a Pod request 1 CPU, grade 1 will be selected.
If a Pod request 1.5 CPU, grade 1 will be ignored as we are not sure it can provide sufficient resources.
Does this PR introduce a user-facing change?:
`karmada-scheduler`: Fixes an issue where resource model grades were incorrectly matched based on resource requests. Now only grades that can provide sufficient resources will be selected.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 39.85%. Comparing base (
29c97e9) to head (a6679dd). Report is 42 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5706 +/- ##
==========================================
+ Coverage 39.15% 39.85% +0.70%
==========================================
Files 650 650
Lines 45207 55145 +9938
==========================================
+ Hits 17701 21980 +4279
- Misses 26142 31753 +5611
- Partials 1364 1412 +48
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 39.85% <100.00%> (+0.70%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
cc @chaosi-zju and @wangxf1987 to take a look.
lgtm
You're absolutely right
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED
Approval requirements bypassed by manually added approval.
This pull-request has been approved by:
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment