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

feat: traffic split #308

Merged
merged 6 commits into from
Mar 22, 2021
Merged

feat: traffic split #308

merged 6 commits into from
Mar 22, 2021

Conversation

tokers
Copy link
Contributor

@tokers tokers commented Mar 19, 2021

Please answer these questions before submitting a pull request

New feature or improvement

  • Describe the details and related test reports.

This PR supports the traffic split in ApisixRoute.


Backport patches

  • Why need to backport?

  • Source branch

  • Related commits and pull requests

  • Target branch

@tokers tokers marked this pull request as draft March 19, 2021 05:09
@codecov-io
Copy link

codecov-io commented Mar 19, 2021

Codecov Report

Merging #308 (3ac2766) into master (f45203e) will increase coverage by 1.26%.
The diff coverage is 63.20%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/kube/translation/apisix_route.go 28.41% <0.00%> (ø)
pkg/kube/translation/plugin.go 100.00% <100.00%> (ø)
pkg/kube/translation/util.go 100.00% <100.00%> (ø)
pkg/seven/state/solver.go 2.00% <0.00%> (-2.00%) ⬇️
test/e2e/e2e.go
pkg/kube/translation/translator.go 56.06% <0.00%> (+3.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f45203e...3ac2766. Read the comment docs.

@tokers tokers marked this pull request as ready for review March 19, 2021 07:20
@tokers tokers linked an issue Mar 19, 2021 that may be closed by this pull request
@tokers tokers added this to the 0.5.0 milestone Mar 19, 2021
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]
Copy link
Contributor

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 ?

Copy link
Contributor Author

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)
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

@tokers tokers merged commit 7eded84 into apache:master Mar 22, 2021
@tokers tokers deleted the feat/traffic-split branch March 22, 2021 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Traffic Split in ApisixRoute
3 participants