-
Notifications
You must be signed in to change notification settings - Fork 589
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
fix(upstreams) deduplicate like targets #5817
Conversation
Combine targets with the same address or hostname by summing their weights into a single target. Previously, same address targets would result in duplicates and would be rejected by Kong.
5ed7bbe
to
4ab8a6c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5817 +/- ##
=======================================
+ Coverage 73.9% 74.0% +0.1%
=======================================
Files 176 176
Lines 18207 18204 -3
=======================================
+ Hits 13455 13471 +16
+ Misses 3749 3732 -17
+ Partials 1003 1001 -2 ☔ View full report in Codecov by Sentry. |
UAT confirmed this appears to resolve the issue. Added unit tests, should be good to go for review now. |
Move target deduplication into a helper and add a unit test.
ab4f566
to
6d65c48
Compare
Combine targets with the same address or hostname by summing their weights into a single target. Previously, same address targets would result in duplicates and would be rejected by Kong. Move target deduplication into a helper and add a unit test. (cherry picked from commit 3e4d430)
Hey @rainest , Thanks a lot for fixing this issue. We are also encountering this issue when using KIC with argo rollouts(using canary), wondering when can we expect the next release/patch release of kic having this fix? |
@mithunkrb probably in 3.2, with a rough timeline of ~1.5months out. https://hub.docker.com/r/kong/nightly-ingress-controller/tags?page=1&ordering=last_updated is available if you want it earlier. Note that we did find a bug in the fix, so you may want to wait til the build after that merges. Not sure what all it affects, but it definitely affects any Services that use the |
What this PR does / why we need it:
Combine targets with the same address or hostname by summing their weights into a single target. Previously, same address targets would result in duplicates and would be rejected by Kong.
Which issue this PR fixes:
Fix #5761. Summing weights wasn't actually that hard!
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR