You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BackendTrafficPolicy RoutingType ignores MergeType, always inherits from broader-scoped policies #9541
BackendTrafficPolicySpec.MergeType's doc comment states: "If unset, no merging occurs, and only the most specific configuration takes effect." This is correctly enforced for most fields via mergeBackendTrafficPolicy (internal/gatewayapi/backendtrafficpolicy.go), which ignores the parent (broader-scoped) policy entirely when MergeType is unset.
However, RoutingType is resolved through a completely separate path: BTPRoutingTypeIndex / LookupBTPRoutingType (internal/gatewayapi/backendtrafficpolicy.go). This does an unconditional route-rule -> route -> listener -> gateway fallthrough, returning the first non-nil RoutingType it finds, with no reference to MergeType anywhere in the lookup or in BuildBTPIndexes' population of the index.
Result: a route-rule-level BackendTrafficPolicy with MergeType unset (which per the field's own doc comment should mean "only this configuration takes effect") will still silently inherit RoutingType from a listener- or gateway-level BackendTrafficPolicy, even though no other field on that policy is allowed to inherit from the parent.
Expected: RoutingType resolution should respect MergeType the same way other BackendTrafficPolicy fields do - either only falling through to a broader-scoped policy when MergeType permits it, or documenting explicitly why RoutingType is a deliberate exception to MergeType's general semantics (if that's intentional).
tentatively assigning this to myself since i am fixing some additional indexes created in #9477 following similar pattern and think it would be easier if i can fix it along with them in one go.
Hi @jukie@zhaohuabing — I've put together a fix for this, but it turned out to also require introducing a shared precedence-resolution primitive that ended up fixing two other related bugs in BTPClusterSettingsIndex (MergeBackends cluster-merge eligibility #9477) along the way, plus migrating BTPLoadBalancerIndex/CTPClusterSettingsIndex onto the same primitive for consistency.
Since #9477 is already a large, active PR, I didn't want to pile this on top of it. I've pushed the full change to a private branch so you can review it independently:
Activity
muwaqar-cflt commentedon Jul 22, 2026
cc @jukie @zirain @kkk777-7 @zhaohuabing
this is a bug from #8173
muwaqar-cflt commentedon Jul 22, 2026
tentatively assigning this to myself since i am fixing some additional indexes created in #9477 following similar pattern and think it would be easier if i can fix it along with them in one go.
muwaqar-cflt commentedon Jul 22, 2026
/assign
muwaqar-cflt commentedon Jul 23, 2026
Hi @jukie @zhaohuabing — I've put together a fix for this, but it turned out to also require introducing a shared precedence-resolution primitive that ended up fixing two other related bugs in BTPClusterSettingsIndex (MergeBackends cluster-merge eligibility #9477) along the way, plus migrating BTPLoadBalancerIndex/CTPClusterSettingsIndex onto the same primitive for consistency.
Since #9477 is already a large, active PR, I didn't want to pile this on top of it. I've pushed the full change to a private branch so you can review it independently:
muwaqar#4
Plan, if the approach looks good to you:
Would appreciate a look at the private PR whenever you get a chance — happy to adjust the split if you'd rather see it land differently.
gatewayapi: fix BTPRoutingTypeIndex to not inherit RoutingType when M…
fix(gatewayapi): don't skip MergeBackends precedence-index claims for…