karmadactl init: add CRDs archive verification to enhance file system robustness
What type of PR is this? /kind feature
What this PR does / why we need it:
karmadactl init provides a custom download path for CRDs files. Before processing the files, it's necessary to validate the CRDs archive to enhance system robustness.
-
check if its file name includes unclean paths.
-
check if the CRDs archive has the expected directory structure.
Which issue(s) this PR fixes: Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 0% with 27 lines in your changes missing coverage. Please review.
Project coverage is 46.28%. Comparing base (
f78e7e2) to head (b7afcaf).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pkg/karmadactl/cmdinit/kubernetes/deploy.go | 0.00% | 18 Missing :warning: |
| pkg/karmadactl/cmdinit/utils/util.go | 0.00% | 9 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5713 +/- ##
==========================================
- Coverage 46.30% 46.28% -0.03%
==========================================
Files 663 663
Lines 54686 54707 +21
==========================================
- Hits 25324 25322 -2
- Misses 27737 27760 +23
Partials 1625 1625
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 46.28% <0.00%> (-0.03%) |
:arrow_down: |
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.
Wait for #5703 as the two PR will share common functions.
Wait for #5703 as the two PR will share common functions.
done~
[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/karmadactl/cmdinit/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