-
Notifications
You must be signed in to change notification settings - Fork 353
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
feat: traffic split #308
feat: traffic split #308
Conversation
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
+ Coverage 53.00% 54.26% +1.26%
==========================================
Files 33 34 +1
Lines 2394 2460 +66
==========================================
+ Hits 1269 1335 +66
- Misses 965 966 +1
+ Partials 160 159 -1
Continue to review full report at Codecov.
|
if len(backends) > 0 { | ||
// Use the first backend as the default backend in Route, | ||
// others will be configured in traffic-split plugin. | ||
backend = backends[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused here, backend
will be covered if backends is not empty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, already check the exclusive relationship before this, when backends
not empty, backend
is nil
.
} | ||
ups.FullName = apisixv1.ComposeUpstreamName(namespace, svcName, svcPort) | ||
ups.Name = ups.FullName | ||
ups.ID = id.GenID(ups.FullName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If upstream.ID is nil, what is the behavior of the controller ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update of Upstream will fail in APISIX side since the necessary ID is not provided by the caller.
Please answer these questions before submitting a pull request
Why submit this pull request?
Bugfix
New feature provided
Improve performance
Backport patches
Related issues
Support Traffic Split in ApisixRoute #289
New feature or improvement
This PR supports the traffic split in ApisixRoute.
Backport patches
Why need to backport?
Source branch
Related commits and pull requests
Target branch