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

✨ (WIP) Extract the logic to add cluster annotations to the driver interface and add unit and integration tests #750

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dtclxy64
Copy link
Contributor

@dtclxy64 dtclxy64 commented Dec 6, 2024

Summary

Extract the logic to add cluster annotations to the driver interface.
Add unit and integration tests.

Related issue(s)

Fixes # #514

@openshift-ci openshift-ci bot requested review from elgnay and ldpliu December 6, 2024 22:27
Copy link
Contributor

openshift-ci bot commented Dec 6, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dtclxy64
Once this PR has been reviewed and has the lgtm label, please assign elgnay 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

…and add unit and integration tests

Signed-off-by: dtclxy64 <[email protected]>
@dtclxy64 dtclxy64 force-pushed the feature/spoke-agent-registration-aws-irsa branch from e5444b4 to cea6a14 Compare December 6, 2024 22:31
Copy link
Member

@mikeshng mikeshng left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

It looks like it's currently failing make verify. Could you please check?

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 65.45455% with 19 lines in your changes missing coverage. Please review.

Project coverage is 63.39%. Comparing base (9eb8131) to head (69a47ed).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...stration/spoke/registration/creating_controller.go 78.37% 6 Missing and 2 partials ⚠️
pkg/registration/register/aws_irsa/aws_irsa.go 0.00% 7 Missing ⚠️
pkg/registration/register/csr/csr.go 0.00% 2 Missing ⚠️
pkg/registration/spoke/spokeagent.go 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #750      +/-   ##
==========================================
+ Coverage   63.33%   63.39%   +0.05%     
==========================================
  Files         187      187              
  Lines       17921    17928       +7     
==========================================
+ Hits        11351    11366      +15     
+ Misses       5635     5628       -7     
+ Partials      935      934       -1     
Flag Coverage Δ
unit 63.39% <65.45%> (+0.05%) ⬆️

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.

@@ -71,6 +71,9 @@ type RegisterDriver interface {
// InformerHandler returns informer of the related object. If no object needs to be watched, the func could
// return nil, nil.
InformerHandler(option any) (cache.SharedIndexInformer, factory.EventFilterFunc)

// AddClusterAnnotations adds cluster annotations for non-CSR drivers
AddClusterAnnotations(clusterAnnotations map[string]string, managedClusterArn string, managedClusterRoleSuffix string)
Copy link
Member

Choose a reason for hiding this comment

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

I could understand the intension. But I wonder it is suitable for an interface since it seems quite specific to a certain implementation. I am thinking whether it makes more sense to have a method like

ClusterDecorator(cluster *v1.ManagedCluster) *v1.ManagedCluster

and call it in the creatingCluster controller.

I can try to create an example PR to show how it looks like.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiujian16 We are incorporating the changes from #752 into our changes. We'll let you know once we are ready for another around of reviews. Thanks for creating the example PR to demonstrate the changes.

And refactor creating to controller to call decorators

Signed-off-by: Jian Qiu <[email protected]>
@dtclxy64 dtclxy64 changed the title ✨ Extract the logic to add cluster annotations to the driver interface and add unit and integration tests ✨ (WIP) Extract the logic to add cluster annotations to the driver interface and add unit and integration tests Dec 9, 2024
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

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.

5 participants