-
Notifications
You must be signed in to change notification settings - Fork 1
[api] add support for DirectReponse #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a new Gateway API extension CRD called DirectResponse that allows HTTPRoute rules to return static HTTP responses without a backend service. This supports the HTTP-01 ACME challenge workflow for serving challenge tokens directly from Envoy. Changes: - Create api/gateway/v1alpha1/ package with DirectResponse type definition - Implement DirectResponseSpec with status code, content-type, headers, and body - Generate deepcopy and register helpers via k8s.io/code-generator - Update codegen/update.sh to include v1alpha1 in code generation pipeline - Generate versioned client code for gateway.apoxy.dev/v1alpha1 Task: Phase 3 - Tasks 3.1, 3.2, 3.3 (DirectResponse CRD creation)
This commit implements the gateway API layer integration for DirectResponse CRD: 1. Added DirectResponses field to Resources struct in pkg/gateway/gatewayapi/resource.go 2. Added gatewayv1alpha1 import to resource.go and gateway.go 3. Updated processExtensionRefHTTPFilter in filters.go to handle DirectResponse filter types - Converts DirectResponse spec to IR DirectResponse struct - Handles status code and body from the CRD spec 4. Added DirectResponse collection logic in reconcileHTTPRoutes in pkg/apiserver/gateway/gateway.go - Detects DirectResponse filters in HTTPRoute rules - Fetches DirectResponse objects from the cluster - Populates res.DirectResponses for use by the translator 5. Regenerated deepcopy methods for Resources struct This enables HTTPRoute filters to reference DirectResponse resources for static HTTP responses. Related to Phase 3 task 3.4, 3.5, 3.6, 3.7
dilyevsky
reviewed
Feb 2, 2026
pkg/apiserver/gateway/gateway.go
Outdated
| "name", ref.GetName(), "gvk", ref.GroupVersionKind()) | ||
| res.ExtensionRefFilters = append(res.ExtensionRefFilters, *ref) | ||
| // Handle DirectResponse specially | ||
| if string(filter.ExtensionRef.Group) == "extensions.apoxy.dev" && string(filter.ExtensionRef.Kind) == "DirectResponse" { |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dilyevsky
reviewed
Feb 2, 2026
pkg/gateway/gatewayapi/filters.go
Outdated
| } | ||
|
|
||
| // Handle DirectResponse specially - convert to IR DirectResponse | ||
| if string(extFilter.Group) == "extensions.apoxy.dev" && string(extFilter.Kind) == "DirectResponse" { |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
dilyevsky
approved these changes
Feb 2, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.