Upgrade gateway-api to support GatewayAPI v1.3+ CORS filters #14836
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The policy controller was using gateway-api crate v0.16, which only supports GatewayAPI v1.2.1. When users deployed HTTPRoutes containing CORS filters (introduced in GatewayAPI v1.3), the policy controller failed to deserialize these objects, causing:
unknown variant 'CORS', expected one of 'RequestHeaderModifier', 'ResponseHeaderModifier'...Solution
gateway-apidependency from v0.16 to v0.19, which supports GatewayAPI v1.4.0Validation
The fix allows HTTPRoute objects with CORS filters to be properly deserialized and processed, eliminating:
Changes
Cargo.toml: Upgrade gateway-api from 0.16 to 0.19policy-controller/k8s/index/src/inbound/index/http.rs: Add CORS and ExternalAuth filter handlingpolicy-controller/k8s/index/src/outbound/index/http.rs: Add CORS and ExternalAuth filter handlingFixes #14741