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 registration #535

Merged

Conversation

qiujian16
Copy link
Member

Summary

Related issue(s)

Fixes #

@openshift-ci openshift-ci bot requested review from elgnay and ldpliu June 20, 2024 08:30
Copy link
Contributor

openshift-ci bot commented Jun 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16

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

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 44.47514% with 201 lines in your changes missing coverage. Please review.

Project coverage is 62.60%. Comparing base (df7d337) to head (24be194).
Report is 9 commits behind head on main.

Files Patch % Lines
pkg/registration/spoke/spokeagent.go 15.87% 53 Missing ⚠️
pkg/registration/register/secret_controller.go 68.75% 18 Missing and 7 partials ⚠️
pkg/registration/register/common.go 48.83% 19 Missing and 3 partials ⚠️
pkg/registration/register/csr/csr.go 71.23% 18 Missing and 3 partials ⚠️
...kg/registration/spoke/registration/registration.go 0.00% 17 Missing ⚠️
...egistration/spoke/addon/registration_controller.go 0.00% 15 Missing ⚠️
pkg/registration/register/interface.go 0.00% 13 Missing ⚠️
pkg/registration/spoke/health_checker.go 33.33% 8 Missing and 2 partials ⚠️
pkg/registration/register/csr/certificate.go 58.82% 5 Missing and 2 partials ⚠️
pkg/registration/spoke/bootstrapkubeconfigs.go 0.00% 7 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #535      +/-   ##
==========================================
+ Coverage   62.41%   62.60%   +0.18%     
==========================================
  Files         177      181       +4     
  Lines       13857    13964     +107     
==========================================
+ Hits         8649     8742      +93     
+ Misses       4339     4338       -1     
- Partials      869      884      +15     
Flag Coverage Δ
unit 62.60% <44.47%> (+0.18%) ⬆️

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.

@qiujian16 qiujian16 force-pushed the reg-refactor branch 7 times, most recently from bb3e409 to 454a392 Compare July 3, 2024 01:43
qiujian16 added 3 commits July 9, 2024 10:58
Signed-off-by: Jian Qiu <jqiu@redhat.com>
Signed-off-by: Jian Qiu <jqiu@redhat.com>
Signed-off-by: Jian Qiu <jqiu@redhat.com>
@@ -246,55 +268,27 @@ func (o *SpokeAgentConfig) RunSpokeAgentWithSpokeInformers(ctx context.Context,
// create a ClientCertForHubController for spoke agent bootstrap
// the bootstrap informers are supposed to be terminated after completing the bootstrap process.
bootstrapInformerFactory := informers.NewSharedInformerFactory(bootstrapKubeClient, 10*time.Minute)
Copy link
Member

Choose a reason for hiding this comment

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

the comments should be updated. there is no ClientCertForHubController now. And please check comments in other places.

IsHubKubeConfigValid(ctx context.Context, secretOption SecretOption) (bool, error)

// BuildKubeConfigFromTemplate builds the kubeconfig from the template kubeconfig
BuildKubeConfigFromTemplate(config *clientcmdapi.Config) *clientcmdapi.Config
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
BuildKubeConfigFromTemplate(config *clientcmdapi.Config) *clientcmdapi.Config
BuildKubeConfigFromTemplate(template *clientcmdapi.Config) *clientcmdapi.Config

Copy link
Member

Choose a reason for hiding this comment

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

Or is it better to make the different driver only provide the auth-info? so the default-auth key will always match the key defined in the BaseKubeConfigFromBootStrap template kubeconfig context.

Copy link
Member Author

Choose a reason for hiding this comment

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

some implementation may also add additional field rather than authinfo, such as execconfig or execvar.

@qiujian16 qiujian16 force-pushed the reg-refactor branch 2 times, most recently from fc475f0 to d3e6793 Compare July 10, 2024 09:20
Signed-off-by: Jian Qiu <jqiu@redhat.com>
@qiujian16 qiujian16 changed the title ✨ [WIP] Refactor registration ✨ Refactor registration Jul 12, 2024
@zhujian7
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jul 17, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 8c1d286 into open-cluster-management-io:main Jul 17, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants