Skip to content

Conversation

@theRealWardo
Copy link
Member

No description provided.

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
"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" {
Copy link
Contributor

Choose a reason for hiding this comment

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

}

// Handle DirectResponse specially - convert to IR DirectResponse
if string(extFilter.Group) == "extensions.apoxy.dev" && string(extFilter.Kind) == "DirectResponse" {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@theRealWardo theRealWardo merged commit 82d9790 into main Feb 3, 2026
1 check failed
@theRealWardo theRealWardo deleted the cname-only-domain-fixes branch February 3, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants