Skip to content

chore: refactor provider #2507

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

Merged
merged 12 commits into from
Aug 19, 2025
Merged

chore: refactor provider #2507

merged 12 commits into from
Aug 19, 2025

Conversation

AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented Aug 13, 2025

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

Description

This commit refactors the adc provider module with the goal of optimizing package structure, reducing module coupling, and improving code maintainability and extensibility.

Changes include
  1. Directory and package structure reorganization
    • Moved code from the original internal/provider/adc directory to a new internal/adc directory.
    • Split the code into sub-packages such as cache, client, and translator, with clearer responsibilities.
    • Split configuration management into a configmanger component
  2. Decoupling and responsibility separation
    • Extracted caching, execution, and resource translation logic from the provider core into separate modules to reduce internal dependencies.
Reason for the changes
  • In the old structure, the adc provider’s various functionalities were tightly coupled at the same level, making maintenance and extension costly.
  • With modular separation, it becomes easier to perform unit testing, replace implementations, or introduce new functional modules in the future.

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@juzhiyuan
Copy link
Member

Just a reminder: when marking this PR as ready for review, please fill in the description and checklist completely.

@bzp2010 bzp2010 self-requested a review August 13, 2025 06:07
@AlinsRan AlinsRan marked this pull request as ready for review August 15, 2025 00:53
@AlinsRan AlinsRan marked this pull request as draft August 15, 2025 01:11
@AlinsRan AlinsRan marked this pull request as ready for review August 18, 2025 00:24
@AlinsRan AlinsRan requested a review from ronething August 18, 2025 00:57
Copy link
Contributor

@ronething ronething left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -89,7 +89,7 @@ jobs:

- name: Install And Run Cloud Provider KIND
run: |
go install sigs.k8s.io/cloud-provider-kind@latest
go install sigs.k8s.io/cloud-provider-kind@v0.6.0
Copy link

Choose a reason for hiding this comment

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

The latest version is 0.7.0, why can't we use latest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

Based on what go releases have done, it doesn't seem to make sense for us to be stuck with older versions, newer versions always include CVE security fixes and runtime improvements.

Maybe we should upgrade it in a later PR.

@AlinsRan AlinsRan requested a review from bzp2010 August 18, 2025 09:29
@AlinsRan AlinsRan merged commit 95787e6 into apache:master Aug 19, 2025
29 of 33 checks passed
@AlinsRan AlinsRan deleted the refactor/provider2 branch August 19, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants