Skip to content

fix: fixed local object reference resolution from parent in merged BackendTrafficPolicies#8210

Merged
rudrakhp merged 1 commit intoenvoyproxy:mainfrom
rudrakhp:fix_merged_policy_refs
Feb 24, 2026
Merged

fix: fixed local object reference resolution from parent in merged BackendTrafficPolicies#8210
rudrakhp merged 1 commit intoenvoyproxy:mainfrom
rudrakhp:fix_merged_policy_refs

Conversation

@rudrakhp
Copy link
Copy Markdown
Member

@rudrakhp rudrakhp commented Feb 8, 2026

What type of PR is this?

fix: fixed local object reference resolution from parent in merged BackendTrafficPolicies

What this PR does / why we need it:

ConfigMap references for custom response body content in parent policy are not being resolved correctly. Resolving LocalObjectRefs pre-merge addresses this issue.

Which issue(s) this PR fixes:

Fixes #8197

Release Notes: Yes

@rudrakhp rudrakhp requested a review from a team as a code owner February 8, 2026 08:39
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 8, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit 5408a17
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/699c5c4555f25a00080597a6

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 62.85714% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.68%. Comparing base (d1b1e5c) to head (5408a17).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/backendtrafficpolicy.go 64.70% 6 Missing and 6 partials ⚠️
internal/gatewayapi/filters.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8210      +/-   ##
==========================================
- Coverage   73.72%   73.68%   -0.04%     
==========================================
  Files         240      240              
  Lines       36917    36946      +29     
==========================================
+ Hits        27216    27224       +8     
- Misses       7772     7787      +15     
- Partials     1929     1935       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rudrakhp rudrakhp changed the title fix: pass parent policy namespace for accessing refs fix: pass parent policy namespace for accessing refs in merged policies Feb 8, 2026
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch 2 times, most recently from 9b00fa3 to 60f248b Compare February 8, 2026 14:03
@@ -0,0 +1,100 @@
# Tests merged BackendTrafficPolicies when ResponseOverride ConfigMap lives in the
# gateway (parent) policy's namespace. Gateway BTP is in envoy-gateway-system with
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice !

@zirain zirain force-pushed the fix_merged_policy_refs branch from 60f248b to 9e2f0ec Compare February 9, 2026 02:11
zirain
zirain previously approved these changes Feb 9, 2026
@zirain zirain requested a review from arkodg February 9, 2026 03:01
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch from 9e2f0ec to 181aec1 Compare February 10, 2026 11:00
@rudrakhp rudrakhp changed the title fix: pass parent policy namespace for accessing refs in merged policies fix: for accessing parent policy refs in merged policies Feb 10, 2026
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch 3 times, most recently from 50947a2 to 51cb904 Compare February 10, 2026 13:14
zirain
zirain previously approved these changes Feb 10, 2026
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch 2 times, most recently from e0c71f3 to a15ec14 Compare February 11, 2026 03:07
@rudrakhp rudrakhp requested a review from zirain February 11, 2026 03:28
zirain
zirain previously approved these changes Feb 11, 2026
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch 3 times, most recently from 1121812 to 05a8cb9 Compare February 15, 2026 09:32
policy.Namespace,
responseOverrideKey,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to save the entire data/field contents here ?
can the map look something like

map[string]string{
    "<ns>/<name>/<field>/<valueRefKind>/<name>": <ns>,
}

this would allow us to

  • save space
  • build a map before using it in buildTrafficFeatures and each new feature can enhance this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cross ns references are a security concern, so will require test coverage for the non happy paths

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arkodg if the exact same local object ref exists in response overrides of parent and route policies, what should be the behavior? Check the first case in the tests I just added.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check same LocalObjectRef different match criteria test where only one local object ref will remain if entire ResponseOverride is not used as key.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

save space

also this is not persisted memory, will be used only while building the IR

@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch 2 times, most recently from de5b86a to f7b9836 Compare February 19, 2026 18:12
@rudrakhp rudrakhp requested a review from arkodg February 20, 2026 08:45
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch 4 times, most recently from 23199e0 to f1e80ad Compare February 23, 2026 13:54
@rudrakhp rudrakhp changed the title fix: access parent policy custom response refs in merged policies fix: fixed local object reference resolution from parent in merged BackendTrafficPolicies Feb 23, 2026
…ckendTrafficPolicies

Signed-off-by: Rudrakh Panigrahi <[email protected]>
@rudrakhp rudrakhp force-pushed the fix_merged_policy_refs branch from f1e80ad to 5408a17 Compare February 23, 2026 13:55
@kkk777-7
Copy link
Copy Markdown
Member

Thanks! LGTM from my side.

@rudrakhp rudrakhp merged commit 1d14e58 into envoyproxy:main Feb 24, 2026
57 of 59 checks passed
antonio-mazzini pushed a commit to antonio-mazzini/gateway that referenced this pull request Mar 5, 2026
cnvergence pushed a commit to cnvergence/gateway that referenced this pull request Mar 11, 2026
cnvergence pushed a commit to cnvergence/gateway that referenced this pull request Mar 11, 2026
…ckendTrafficPolicies (envoyproxy#8210)

Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
cnvergence pushed a commit to cnvergence/gateway that referenced this pull request Mar 11, 2026
…ckendTrafficPolicies (envoyproxy#8210)

Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
cnvergence pushed a commit to cnvergence/gateway that referenced this pull request Mar 11, 2026
…ckendTrafficPolicies (envoyproxy#8210)

Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
jukie pushed a commit that referenced this pull request Mar 12, 2026
* api: make ConnectionLimit.Value optional (#8478)

* api: make ConnectionLimit.Value optional

Signed-off-by: Felipe Sabadini Facina <[email protected]>

* release-notes: add entry for ConnectionLimit.Value optional

Signed-off-by: Felipe Sabadini Facina <[email protected]>

* fix: add CEL rule to require value when closeDelay is set

Signed-off-by: Felipe Sabadini Facina <[email protected]>

---------

Signed-off-by: Felipe Sabadini Facina <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix up release notes

Signed-off-by: Karol Szwaj <[email protected]>

* fix: aggregate xRoute/xPolicy statuses across GWCs in gateway-api runner (#8387)

* fix: aggregate xRoute/xPolicy statuses across GWCs in gateway-api runner

Signed-off-by: y-rabie <[email protected]>

* polish

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* add e2e test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* release note

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* truncate policy status & add tests

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* update

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* update

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: y-rabie <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Co-authored-by: y-rabie <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: active health check respect endpoint hostname (#8452)

revert unrelated changes

Signed-off-by: zirain <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: exclude unmanaged route parents from xPolicy status ancestors (#8321)

* add test for mixed managed and unmanaged Gateway parents

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix the policy status when the targeting routes have managed and unmanged Gateway parents

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: add ownerReferences to ratelimit ConfigMap and HPA (#8358)

Signed-off-by: Tejasriram Parvathaneni <[email protected]>
Co-authored-by: Karol Szwaj <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: computeHosts doesn't work when listener and route both wildcard  (#8186)

* fix: computeHosts doesn't work when listener and route both wildcard

Signed-off-by: zirain <[email protected]>

* remove skipped tests

Signed-off-by: zirain <[email protected]>

* Update internal/gatewayapi/helpers.go

Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: fixed local object reference resolution from parent in merged BackendTrafficPolicies (#8210)

Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: XListenerSet allows route from same namespace (#8226)

Previously, using allowedRoutes/Same for an XListenerSet with an xRoute
in the same namespace would return an error. Now it properly allows
xRoutes from the same namespace.

Signed-off-by: Kris Hicks <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix: API key auth (#8267)

* add test for multiple keys

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* revert secret transform

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>

* fix gen-check

Signed-off-by: Karol Szwaj <[email protected]>

* add release notes

Signed-off-by: Karol Szwaj <[email protected]>

* add release notes for envoy proxy image

Signed-off-by: Karol Szwaj <[email protected]>

---------

Signed-off-by: Felipe Sabadini Facina <[email protected]>
Signed-off-by: Karol Szwaj <[email protected]>
Signed-off-by: y-rabie <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: Tejasriram Parvathaneni <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Kris Hicks <[email protected]>
Co-authored-by: Felipe Sabadini Facina <[email protected]>
Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Co-authored-by: y-rabie <[email protected]>
Co-authored-by: zirain <[email protected]>
Co-authored-by: Tejasriram Parvathaneni <[email protected]>
Co-authored-by: Rudrakh Panigrahi <[email protected]>
Co-authored-by: Kris Hicks <[email protected]>
rudrakhp added a commit to rudrakhp/gateway that referenced this pull request Mar 12, 2026
rudrakhp added a commit to rudrakhp/gateway that referenced this pull request Mar 12, 2026
rudrakhp added a commit to rudrakhp/gateway that referenced this pull request Mar 12, 2026
rudrakhp added a commit to rudrakhp/gateway that referenced this pull request Mar 12, 2026
rudrakhp added a commit that referenced this pull request Mar 12, 2026
* fix: fixed local object reference resolution from parent in merged BackendTrafficPolicies (#8210)

Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: exclude unmanaged route parents from xPolicy status ancestors (#8321)

* add test for mixed managed and unmanaged Gateway parents

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix the policy status when the targeting routes have managed and unmanged Gateway parents

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* fix test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: computeHosts doesn't work when listener and route both wildcard  (#8186)

* fix: computeHosts doesn't work when listener and route both wildcard

Signed-off-by: zirain <[email protected]>

* remove skipped tests

Signed-off-by: zirain <[email protected]>

* Update internal/gatewayapi/helpers.go

Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: aggregate xRoute/xPolicy statuses across GWCs in gateway-api runner (#8387)

* fix: aggregate xRoute/xPolicy statuses across GWCs in gateway-api runner

Signed-off-by: y-rabie <[email protected]>

* polish

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* add e2e test

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* release note

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* truncate policy status & add tests

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* update

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

* update

Signed-off-by: Huabing (Robin) Zhao <[email protected]>

---------

Signed-off-by: y-rabie <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Co-authored-by: y-rabie <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix: add ownerReferences to ratelimit ConfigMap and HPA (#8358)

Signed-off-by: Tejasriram Parvathaneni <[email protected]>
Co-authored-by: Karol Szwaj <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* api: make ConnectionLimit.Value optional (#8478)

* api: make ConnectionLimit.Value optional

Signed-off-by: Felipe Sabadini Facina <[email protected]>

* release-notes: add entry for ConnectionLimit.Value optional

Signed-off-by: Felipe Sabadini Facina <[email protected]>

* fix: add CEL rule to require value when closeDelay is set

Signed-off-by: Felipe Sabadini Facina <[email protected]>

---------

Signed-off-by: Felipe Sabadini Facina <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix test race (#8180)

* fix test race

Signed-off-by: zirain <[email protected]>

* use io.Discard

Signed-off-by: zirain <[email protected]>

* use sync.WaitGroup

Signed-off-by: zirain <[email protected]>

---------

Signed-off-by: zirain <[email protected]>
Signed-off-by: Isaac Wilson <[email protected]>
Co-authored-by: Isaac Wilson <[email protected]>
Signed-off-by: Rudrakh Panigrahi <[email protected]>

* fix gen check

Signed-off-by: Rudrakh Panigrahi <[email protected]>

---------

Signed-off-by: Rudrakh Panigrahi <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: zirain <[email protected]>
Signed-off-by: y-rabie <[email protected]>
Signed-off-by: Tejasriram Parvathaneni <[email protected]>
Signed-off-by: Felipe Sabadini Facina <[email protected]>
Signed-off-by: Isaac Wilson <[email protected]>
Co-authored-by: Huabing (Robin) Zhao <[email protected]>
Co-authored-by: zirain <[email protected]>
Co-authored-by: y-rabie <[email protected]>
Co-authored-by: Teja079 <[email protected]>
Co-authored-by: Karol Szwaj <[email protected]>
Co-authored-by: Felipe Sabadini <[email protected]>
Co-authored-by: Isaac Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResponseOverride ConfigMap references break with merged BackendTrafficPolicies in multiple namespaces

7 participants