karmada icon indicating copy to clipboard operation
karmada copied to clipboard

Fixes incorrect resource model selection

Open RainbowMango opened this issue 1 year ago • 4 comments

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.

RainbowMango avatar Oct 18 '24 06:10 RainbowMango

:warning: Please install the 'codecov app svg image' 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.

codecov-commenter avatar Oct 18 '24 07:10 codecov-commenter

cc @chaosi-zju and @wangxf1987 to take a look.

RainbowMango avatar Oct 21 '24 03:10 RainbowMango

lgtm

wangxf1987 avatar Oct 21 '24 08:10 wangxf1987

You're absolutely right

/lgtm

chaosi-zju avatar Oct 22 '24 13:10 chaosi-zju

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar Oct 23 '24 06:10 karmada-bot