Closed sunbinnnnn closed 11 months ago
Welcome @sunbinnnnn! It looks like this is your first PR to karmada-io/karmada 🎉
/cc @Poor12 @halfrost
@XiShanYongYe-Chang: GitHub didn't allow me to request PR reviews from the following users: halfrost.
Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs.
Merging #3591 (efb2ce0) into master (218a0b2) will decrease coverage by
0.01%
. The diff coverage is100.00%
.
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@ Coverage Diff @@
## master #3591 +/- ##
==========================================
- Coverage 55.86% 55.85% -0.01%
==========================================
Files 216 216
Lines 20121 20121
==========================================
- Hits 11240 11238 -2
- Misses 8276 8278 +2
Partials 605 605
Flag | Coverage Δ | |
---|---|---|
unittests | 55.85% <100.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
pkg/modeling/modeling.go | 71.09% <100.00%> (ø) |
Thanks @sunbinnnnn. After I went through the code, I find that add this validation is not a thoroughly solution. I suggest the change:
// generate a sorted array by first priority of ResourceName
modelSortings = make([][]resource.Quantity, len(rsList))
to
// generate a sorted array by first priority of ResourceName
modelSortings = make([][]resource.Quantity, len(rsName))
I agree with @Poor12 's solution. Increasing the capacity of modelSortings is a more thorough solution.
LGTM
I think this issue needs to cherry-pick. For release node, I propose:
karmada-controller-manager: fix the issue that controller-manager panic when the grade number of resourceModel is less than number of resource
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: RainbowMango
The full list of commands accepted by this bot can be found here.
The pull request process is described here
If grade number of resourceModel less than rsName, the controller may panic with index error.
What type of PR is this?
/kind bug
What this PR does / why we need it: Add a precheck to check if resource model grades less than resources count.
Which issue(s) this PR fixes: Fixes #3472
Special notes for your reviewer:
Does this PR introduce a user-facing change?: