karmada
karmada copied to clipboard
add verify for customized dependencies response
What type of PR is this?
/kind feature
What this PR does / why we need it:
After the user customizes interpretation behavior, the Dependencies returned by the InterpretDependency interpreter are verified to prevent incorrect return values from penetrating into subsequent use logic.
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
NONE
/cc @chaunceyjiang @whitewindmills
/assign
/assign
It's just a question, how did you discover that optimization could be done here?
I've been working on the #1741 issue recently. I read the code of the dependencies distributor module and found some confusing naming. So I submitted PR #4980.
In the #4980, there is an error info output:
https://github.com/karmada-io/karmada/blob/f414fa04b8e87ccd3fe11f8766a79339dfc8f8a6/pkg/dependenciesdistributor/dependencies_distributor.go#L326
I think this error message should be discovered much earlier, so I submitted this PR
thanks for your quick response. /lgtm
Codecov Report
Attention: Patch coverage is 56.25000% with 7 lines in your changes are missing coverage. Please review.
Project coverage is 53.32%. Comparing base (
d676996) to head (8ec02ca).
| Files | Patch % | Lines |
|---|---|---|
| pkg/resourceinterpreter/default/native/default.go | 0.00% | 4 Missing :warning: |
| ...sourceinterpreter/default/thirdparty/thirdparty.go | 0.00% | 3 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #4982 +/- ##
=======================================
Coverage 53.31% 53.32%
=======================================
Files 252 253 +1
Lines 20539 20554 +15
=======================================
+ Hits 10951 10960 +9
- Misses 8862 8869 +7
+ Partials 726 725 -1
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 53.32% <56.25%> (+<0.01%) |
: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 @RainbowMango
Why not verify the dependencies returned from the default interpreters?
I think that the return body of external requests should be verified. The default interpreter does not involve external requests. It should be determined that the code is normal when it is written.
@chaunceyjiang what's your opinion on this?
Why not verify the dependencies returned from the default interpreters?
Good question! I believe third-party interpreters also need this.
Yes, that's exactly the reason why I'm asking.
Validation for the InterpretDependency operation has been added for all interpreters.
[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
- ~~pkg/resourceinterpreter/OWNERS~~ [RainbowMango]
- ~~pkg/util/OWNERS~~ [RainbowMango]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment