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

refactor pool-coordinator-cert controller #1364

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

rambohe-ch
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind bug

What this PR does / why we need it:

  • background:
    pool coordinator cert controller is used for preparing certificates for pool coordinator component, and it should wait for service of pool-coordinator ready before creating certificates. At present, all certificates preparation is handled in controller setup, so other controllers setup are blocked by pool coordinator cert controller.

  • solution:
    separate allSelfSignedCerts into three kinds:

    • allIndependentCerts: don't depend on service, and can be prepared in controller setup phase.
    • certsDependOnAPIServerSvc: depend on apiserver service, and should be prepared in controller reconcile
    • certsDependOnETCDSvc: depend on etcd service, and should be prepared in controller reconcile

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@rambohe-ch: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage

/kind bug

What this PR does / why we need it:

  • background:
    pool coordinator cert controller is used for preparing certificates for pool coordinator component, and it should wait for service of pool-coordinator ready before creating certificates. At present, all certificates preparation is handled in controller setup, so other controllers setup are blocked by pool coordinator cert controller.

  • solution:
    separate allSelfSignedCerts into three kinds:

  • allIndependentCerts: don't depend on service, and can be prepared in controller setup phase.

  • certsDependOnAPIServerSvc: depend on apiserver service, and should be prepared in controller reconcile

  • certsDependOnETCDSvc: depend on etcd service, and should be prepared in controller reconcile

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rambohe-ch

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

@openyurt-bot openyurt-bot added the approved approved label Apr 11, 2023
@rambohe-ch
Copy link
Member Author

@luc99hen PTAL

@openyurt-bot openyurt-bot added the size/L size/L: 100-499 label Apr 11, 2023
@rambohe-ch rambohe-ch force-pushed the refactor-cert-controller branch from 1db3a2d to 0581431 Compare April 11, 2023 08:48
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #1364 (f27e19d) into master (172d551) will decrease coverage by 0.27%.
The diff coverage is 4.03%.

❗ Current head f27e19d differs from pull request most recent head 0c1fc84. Consider uploading reports for the commit 0c1fc84 to get more accurate results

@@            Coverage Diff             @@
##           master    #1364      +/-   ##
==========================================
- Coverage   52.86%   52.59%   -0.27%     
==========================================
  Files         103      103              
  Lines       12928    12989      +61     
==========================================
- Hits         6834     6832       -2     
- Misses       5537     5599      +62     
- Partials      557      558       +1     
Flag Coverage Δ
unittests 52.59% <4.03%> (-0.27%) ⬇️

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

Impacted Files Coverage Δ
pkg/util/kubeconfig/kubeconfig.go 48.64% <0.00%> (-6.74%) ⬇️
...coordinator/cert/poolcoordinatorcert_controller.go 11.94% <2.72%> (-3.97%) ⬇️
pkg/controller/poolcoordinator/cert/certificate.go 49.16% <25.00%> (-0.67%) ⬇️
pkg/controller/poolcoordinator/cert/secret.go 75.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rambohe-ch rambohe-ch force-pushed the refactor-cert-controller branch from 0581431 to f27e19d Compare April 11, 2023 08:59
@rambohe-ch rambohe-ch force-pushed the refactor-cert-controller branch from f27e19d to 0c1fc84 Compare April 11, 2023 09:00
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
2.0% 2.0% Duplication

@YTGhost
Copy link
Member

YTGhost commented Apr 11, 2023

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Apr 11, 2023
@openyurt-bot openyurt-bot merged commit 2e07f81 into openyurtio:master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved lgtm lgtm size/L size/L: 100-499
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants