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

Add composite provider to support multiple network providers #224

Conversation

lujiajing1126
Copy link
Contributor

@lujiajing1126 lujiajing1126 commented Jun 28, 2024

Ⅰ. Describe what this PR does

Currently, only a single trafficRouting network provider is supported even multiple ones are defined.

To accomplish this, a composite provider is needed. A composite provider is just an array of NetworkProvider.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Special notes for reviews

@kruise-bot
Copy link

[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 fillzpp for approval by writing /assign @fillzpp in a comment. 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

Copy link

codecov bot commented Jun 28, 2024

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 43.27%. Comparing base (07c1731) to head (b5e3760).
Report is 5 commits behind head on master.

Current head b5e3760 differs from pull request most recent head f10a004

Please upload reports for the commit f10a004 to get more accurate results.

Files Patch % Lines
pkg/trafficrouting/manager.go 26.66% 7 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
- Coverage   43.63%   43.27%   -0.37%     
==========================================
  Files          52       53       +1     
  Lines        5681     5849     +168     
==========================================
+ Hits         2479     2531      +52     
- Misses       2778     2877      +99     
- Partials      424      441      +17     
Flag Coverage Δ
unittests 43.27% <26.66%> (-0.37%) ⬇️

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.

@kruise-bot kruise-bot added size/L and removed size/M labels Jun 28, 2024
@lujiajing1126 lujiajing1126 force-pushed the feature/support-multiple-traffic-routing branch from 645cb4d to 50a3871 Compare July 1, 2024 02:15
@lujiajing1126 lujiajing1126 marked this pull request as ready for review July 1, 2024 02:27
@kruise-bot kruise-bot requested a review from zmberg July 1, 2024 02:27
@zmberg
Copy link
Member

zmberg commented Jul 2, 2024

@lujiajing1126 There is no problem with the code logic and implementation. We didn't implement it before mainly because we didn't think through the scenarios, so would it be convenient for you to participate in a community meeting? Time: 7.11. Alternatively, you can join the dingding group and we'll talk further!

@lujiajing1126
Copy link
Contributor Author

@lujiajing1126 There is no problem with the code logic and implementation. We didn't implement it before mainly because we didn't think through the scenarios, so would it be convenient for you to participate in a community meeting? Time: 7.11. Alternatively, you can join the dingding group and we'll talk further!

Yes, sure. I've already in the Dingtalk group and will attend the community meeting on 11, Jul.

@lujiajing1126 lujiajing1126 force-pushed the feature/support-multiple-traffic-routing branch from f10a004 to ed6819f Compare August 16, 2024 01:06
return nil
}

func (c CompositeController) EnsureRoutes(ctx context.Context, strategy *v1beta1.TrafficRoutingStrategy) (bool, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow the logic of CustomNetworkProvider here.

Gentle Ping @myname4423 @zmberg for review

Signed-off-by: Megrez Lu <[email protected]>
Signed-off-by: Megrez Lu <[email protected]>
Signed-off-by: Megrez Lu <[email protected]>
Signed-off-by: Megrez Lu <[email protected]>
@lujiajing1126 lujiajing1126 force-pushed the feature/support-multiple-traffic-routing branch from 94c048e to 844d656 Compare September 15, 2024 07:20
@lujiajing1126
Copy link
Contributor Author

Test cases have been moved to v1beta1 file and a workflow has been added. @myname4423

@zmberg
Copy link
Member

zmberg commented Nov 1, 2024

/lgtm

@zmberg zmberg merged commit 6854752 into openkruise:master Nov 1, 2024
21 of 22 checks passed
@lujiajing1126 lujiajing1126 deleted the feature/support-multiple-traffic-routing branch November 1, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants