Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

karmada-operator: add CRDs archive verification to enhance file system robustness #5703

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

zhzhuang-zju
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
karmada-operator 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 relative paths.

  • check if the CRDs archive has the expected directory structure.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
karamdactl init has the same issue, and its enhancement is ongoing

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 17, 2024
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 17, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 38.27160% with 50 lines in your changes missing coverage. Please review.

Project coverage is 46.28%. Comparing base (ccdf485) to head (63590cb).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
pkg/util/validation/validation.go 54.38% 26 Missing ⚠️
operator/pkg/tasks/init/crd.go 0.00% 23 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5703      +/-   ##
==========================================
+ Coverage   46.21%   46.28%   +0.07%     
==========================================
  Files         663      663              
  Lines       54592    54686      +94     
==========================================
+ Hits        25230    25314      +84     
- Misses      27735    27745      +10     
  Partials     1627     1627              
Flag Coverage Δ
unittests 46.28% <38.27%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhzhuang-zju zhzhuang-zju force-pushed the security branch 2 times, most recently from bc24da3 to 61c1f12 Compare October 18, 2024 10:04
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 18, 2024
@zhzhuang-zju zhzhuang-zju force-pushed the security branch 2 times, most recently from c178c66 to a809285 Compare October 19, 2024 06:54
@zhzhuang-zju zhzhuang-zju changed the title add CRDs archive verification to enhance file system robustness karmada-operator: add CRDs archive verification to enhance file system robustness Oct 24, 2024
@zhzhuang-zju
Copy link
Contributor Author

cc @RainbowMango

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit, otherwise LGTM.

operator/pkg/util/util.go Outdated Show resolved Hide resolved
…m robustness

Signed-off-by: zhzhuang-zju <m17799853869@163.com>
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2024
@karmada-bot
Copy link
Collaborator

[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

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 karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 27, 2024
@karmada-bot karmada-bot merged commit f78e7e2 into karmada-io:master Nov 27, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants