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

remove the unnecessary file localization steps when karmadactl register #5862

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

zhzhuang-zju
Copy link
Contributor

@zhzhuang-zju zhzhuang-zju commented Nov 22, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
When executing the karmadactl register command, there are many localized file operations involved, which lead to the following issues:

  • The current file storage path is /etc/karmada, and non-admin users will not have permission to create this directory. see #test/e2e/karmadactl_test.go: test register command #5334 (comment)
  • Sensitive information such as CA should not be stored in files
  • When karmadactl register fails, the residual files can cause the next execution of karmadactl register to fail.

In fact, the file localization steps in karmadactl register are unnecessary and can be removed.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
If we want to use karmadactl register in CI to join a pull mode cluster, it will fail due to lack of root permissions.
https://github.com/karmada-io/karmada/actions/runs/11608077257/job/32322805939?pr=5763#step:5:934

Does this PR introduce a user-facing change?:

`karmadactl`: The flag `--ca-cert-path` has been marked deprecated because it has never been used, and will be removed in the future release.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 22, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 22, 2024
@zhzhuang-zju
Copy link
Contributor Author

cc @mohamedawnallah

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

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

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 48.23%. Comparing base (079d0ab) to head (623a4f9).
Report is 124 commits behind head on master.

Files with missing lines Patch % Lines
pkg/karmadactl/register/register.go 0.00% 6 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5862      +/-   ##
==========================================
+ Coverage   46.31%   48.23%   +1.92%     
==========================================
  Files         661      664       +3     
  Lines       54364    54737     +373     
==========================================
+ Hits        25177    26401    +1224     
+ Misses      27562    26620     -942     
- Partials     1625     1716      +91     
Flag Coverage Δ
unittests 48.23% <0.00%> (+1.92%) ⬆️

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.

@mohamedawnallah
Copy link
Contributor

Hi @zhzhuang-zju, sorry for the delay in reviewing the PR. I haven't had the chance to review it yet. I’ll give it a full review today. 🙏

@zhzhuang-zju
Copy link
Contributor Author

Hi @zhzhuang-zju, sorry for the delay in reviewing the PR. I haven't had the chance to review it yet. I’ll give it a full review today. 🙏

It's okay, just go at your own pace. 😄

Copy link
Contributor

@mohamedawnallah mohamedawnallah left a comment

Choose a reason for hiding this comment

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

Great work, @zhzhuang-zju! LGTM 🎉 A small tweak that resolves a few issues—well done! 👌 I'll follow up on the PR for the E2E tests of the register command (#5334) after this PR is merged.

@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.

/assign

@RainbowMango
Copy link
Member

Deprecated: Flag --ca-cert-path flag of command register is deprecated, has no effect and will be removed in a future version.

Release notes:
karmadactl: The flag --ca-cert-path has been marked deprecated because it has never been used, and will be removed in the future release.

@RainbowMango
Copy link
Member

/remove-kind feature
/kind deprecation

@karmada-bot karmada-bot added kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Dec 20, 2024
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 Dec 20, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mohamedawnallah, 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 Dec 20, 2024
@karmada-bot karmada-bot merged commit 6e3316f into karmada-io:master Dec 20, 2024
21 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/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. 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.

5 participants