-
Notifications
You must be signed in to change notification settings - Fork 605
fix(targets) deduplicate nil-weight targets #5946
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5946 +/- ##
======================================
Coverage ? 67.3%
======================================
Files ? 179
Lines ? 18304
Branches ? 0
======================================
Hits ? 12327
Misses ? 5032
Partials ? 945 ☔ View full report in Codecov by Sentry. |
#5848 |
f169cfe
to
f6eadd4
Compare
@randmonkey hmm, that's annoying, I guess there's no way to tell backports from the commit data. The echo manifest lacks the |
Assume the Kong default 100 weight for targets that have nil weight when being deduplicated.
f6eadd4
to
5539522
Compare
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.1.x release/3.1.x
# Navigate to the new working tree
cd .worktrees/backport-release/3.1.x
# Create a new branch
git switch --create backport-5946-to-release/3.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b8f7eb54420592f8ada2078082cb49170cf364e0
# Push it to GitHub
git push --set-upstream origin backport-5946-to-release/3.1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.1.x Then, create a pull request where the |
Assume the Kong default 100 weight for targets that have nil weight when being deduplicated. (cherry picked from commit b8f7eb5)
* fix(targets) deduplicate nil-weight targets (#5946) Assume the Kong default 100 weight for targets that have nil weight when being deduplicated. (cherry picked from commit b8f7eb5) * add changelog entry --------- Co-authored-by: Travis Raines <[email protected]>
What this PR does / why we need it:
Assume the Kong default 100 weight for targets that have nil weight when being deduplicated.
Which issue this PR fixes:
#5817 results in a segfault if deduplicated targets have no weight. I'm not sure if this happens in other cases, but it definitely happens for multi-replica Services that use the service-upstream annotation. We generate multiple targets all with the same Service hostname for service-upstream, which is maybe a bit silly, but I saw no reason to change it and wanted to make sure we cover any other situations that may generate nil-weight targets.
See segfault.txt for the fault. https://github.com/Kong/go-echo/blob/main/example_deploy.yaml will trigger it in current nightly.
Special notes for your reviewer:
I cannibalized
TestIngressNamespaces()
to test service-upstream in general. service-upstream is common enough (most mesh users, AFAIK) and we apparently never had an integration test that utilized it.While looking for a test I could maybe slot it into, I discovered that a test added long long ago was no longer really testing anything in particular due to refactors elsewhere, so I have repurposed it into the service-upstream test.
The thing it was originally testing is mostly irrelevant, since we were mostly re-testing functionality built into controller-runtime.
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:thefix for unreleased change.CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR