fix: aggregate xRoute/xPolicy statuses across GWCs in gateway-api runner#8387
Conversation
Signed-off-by: y-rabie <[email protected]>
✅ Deploy Preview for cerulean-figolla-1f9435 canceled.
|
7fbcd34 to
e97967c
Compare
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (18.67%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8387 +/- ##
==========================================
- Coverage 74.23% 74.09% -0.15%
==========================================
Files 242 242
Lines 37322 37405 +83
==========================================
+ Hits 27705 27714 +9
- Misses 7686 7757 +71
- Partials 1931 1934 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
da9c884 to
71581c2
Compare
| // Backend statuses have no parents, so they are not aggregated. | ||
| for _, backend := range result.Backends { | ||
| key := utils.NamespacedName(backend) | ||
| if len(backend.Status.Conditions) > 0 { |
There was a problem hiding this comment.
I'm not sure why we need this check, which is inconsistent with Gateway and listenerSet, but it's the existing behavior. cc @arkodg
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
internal/gatewayapi/runner/runner.go
Outdated
| ExtensionServerPolicies: make(map[message.NamespacedNameAndGVK]*gwapiv1.PolicyStatus), | ||
| } | ||
|
|
||
| mergeRouteStatus := func(status, other *gwapiv1.RouteStatus) *gwapiv1.RouteStatus { |
There was a problem hiding this comment.
can we add a _test.go that includes tests for mergeRouteStatus and mergePolicyStatus since these are not covered by the testdata yaml ?
There was a problem hiding this comment.
Added unit tests for mergeRouteStatus and mergePolicyStatus. Also e2e tests for BackendTrafficPolicy and HTTPRoute with multiple GCs.
internal/gatewayapi/runner/runner.go
Outdated
| if other != nil { | ||
| if status != nil { | ||
| status.Parents = append(status.Parents, other.Parents...) | ||
| } else { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Would you mind if we handle the route cap in a follow-up PR? It’s a broader existing issue, and I’d like to keep the scope of this PR focused.
This is unlikely to happen - the cap is 32, and keep that fix out would help CP this PR to v1.7.1 and v1.6.5.
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
…ner (envoyproxy#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]>
…ner (envoyproxy#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]>
…ner (envoyproxy#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]>
…ner (envoyproxy#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]>
* 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]>
…ner (envoyproxy#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]>
…ner (envoyproxy#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]>
…ner (envoyproxy#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]>
…ner (envoyproxy#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: 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]>
This PR aggregates route and policy status across multiple GatewayClasses managed by the same controller, so resources preserve status from all relevant parents and ancestors instead of being overwritten by the last processed GatewayClass.
Fixes: #8318
Release note: yes
This PR continues the work from #7557. Thanks @y-rabie for all your previous work on this!