Skip to content

refactor: Optimize the process of cluster registration #6499

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhzhuang-zju
Copy link
Contributor

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Ref to #6214 (comment), the current cluster registration process has the following issues:

  • Unreasonable function behavior
  • Multiple execution branches
  • Useless operations
  • Relatively scattered processes, prone to issues such as unassigned parameters or null pointers.

In this refactoring, while preserving the original process, functions are aggregated and divided into three sub-modules: parameter initialization, parameter validation, and execution, which simplifies the behavior of callers.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 28, 2025
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign whitewindmills for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 28, 2025
@codecov-commenter
Copy link

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

Codecov Report

Attention: Patch coverage is 67.50000% with 65 lines in your changes missing coverage. Please review.

Project coverage is 45.61%. Comparing base (ea9bcec) to head (9af7086).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
pkg/util/cluster.go 67.03% 45 Missing and 15 partials ⚠️
cmd/agent/app/agent.go 0.00% 3 Missing ⚠️
pkg/karmadactl/join/join.go 86.66% 0 Missing and 2 partials ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6499      +/-   ##
==========================================
- Coverage   48.98%   45.61%   -3.38%     
==========================================
  Files         687      686       -1     
  Lines       56097    56114      +17     
==========================================
- Hits        27481    25595    -1886     
- Misses      26836    28923    +2087     
+ Partials     1780     1596     -184     
Flag Coverage Δ
unittests 45.61% <67.50%> (-3.38%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants