feat(api): add Selector to MergeBackendsConfig to restrict cluster deduplication - #9624
feat(api): add Selector to MergeBackendsConfig to restrict cluster deduplication#9624muwaqar-cflt wants to merge 11 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aadc0be6c6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9624 +/- ##
==========================================
+ Coverage 76.19% 76.20% +0.01%
==========================================
Files 261 261
Lines 43528 43566 +38
==========================================
+ Hits 33164 33198 +34
- Misses 8161 8164 +3
- Partials 2203 2204 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aadc0be to
0b511e5
Compare
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
Replace Translator.MergeBackends bool with *MergeBackendsConfig, an
internal mirror of egv1a1.MergeBackendsConfig{Enabled, Selector}, and
IsMergeBackendsEnabled with ResolveMergeBackendsConfig which resolves
both fields together using the same GatewayClass/global-default
precedence. Selector is plumbed through but not yet consulted by
shouldMergeBackend; that eligibility wiring is a follow-up.
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
…ector Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
…urrent IR naming Picks up the backends->backendClusters registry rename, the dropped backend/ cluster-name prefix, and the internal proxy-service cluster no longer being spuriously registered as a merge candidate - all landed on backend-cluster-dedup-rebase since this fixture was authored. Signed-off-by: Muhammad Waqar <mwaqar@confluent.io>
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
… IR structure The old model put every route-scoped Cluster (merged or not) under one flat Backends list discriminated by a merged flag. Today's ir.Xds only registers genuinely merged clusters in BackendClusters; a non-merged backend lives inline in its route's destination.settings instead. Also picks up the dropped backend/ cluster-name prefix. Signed-off-by: Muhammad Waqar <mwaqar@confluent.io>
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
…rim comments Move the nil-selector short-circuit out of mergeBackendsSelectorMatches into its caller - a selector-match function returning true for "no selector" was confusing. Fix the Selector doc comment to also mention ServiceImport, which the matching code already supported. Trim a few over-explained/history-narrating comments down to repo convention. Signed-off-by: Muhammad Waqar <mwaqar@confluent.io>
…go-control-plane bump Rebasing onto main picked up a go-control-plane dependency bump that added an explicit initialFetchTimeout default to RDS ConfigSource, which this branch's fixture predates. Signed-off-by: Muhammad Waqar <mwaqar@confluent.io>
7f7b7c9 to
1a2743d
Compare
What this PR does / why we need it:
Adds a
selectorfield toEnvoyProxy.spec.mergeBackends, restricting cluster deduplication to backends whose target Service or Backend resource matches a label selector. When unset, every otherwise-eligible backend is merged (today's behavior, unchanged). This lets operators opt individual backends into deduplication gradually instead of enabling it for every backend at once.The resolved MergeBackends config (enabled + selector) is now computed once per
TranslatorviaResolveMergeBackendsConfig, replacing the old plainbool, soshouldMergeBackendcan consult both fields together with the same GatewayClass/global-default precedence, and a Gateway-levelEnvoyProxyoverride still wins over that resolved value wholesale (not merged field-by-field).Which issue(s) this PR fixes:
N/A - new feature request, no linked issue.
PR Checklist
git commit -s).go build ./...,go vet ./...,gofmt -l,make lint.golint, andgo test ./...all pass.make gen-checkshows no drift beyond this PR's own changes.helpers_test.goandroute_test.go, a gateway-to-IR translator fixture, and an xds-ir translator fixture for a Selector-excluded backend.extension_types.md) and CRD YAML manifests.release-notes/current/new_features/mergebackends-selector.md.zz_generated.deepcopy.go, CRD YAML manifests, and helm-template golden fixtures regenerated and committed.