-
Notifications
You must be signed in to change notification settings - Fork 446
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
Introduce a v1alpha1 DirectResponse CRD #9960
Introduce a v1alpha1 DirectResponse CRD #9960
Conversation
Issues linked to changelog: |
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
095d21b
to
526f927
Compare
This commit introduces a new v1alpha1 CRD that allows users to configure direct response functionality within the K8S Gateway API integration. Signed-off-by: timflannagan <[email protected]>
526f927
to
496fcb4
Compare
Signed-off-by: timflannagan <[email protected]>
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
install/helm/gloo/crds/gateway.gloo.solo.io_directresponseroutes.yaml
Outdated
Show resolved
Hide resolved
install/helm/gloo/crds/gateway.gloo.solo.io_directresponseroutes.yaml
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin_test.go
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
test/kubernetes/e2e/features/directresponse/testdata/setup.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
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.
looks great; dropping some comments for my first pass
install/helm/gloo/crds/gateway.gloo.solo.io_directresponseroutes.yaml
Outdated
Show resolved
Hide resolved
test/kubernetes/e2e/features/directresponse/testdata/basic-delegation-direct-response.yaml
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin_test.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin_test.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
Signed-off-by: timflannagan <[email protected]>
// | ||
// +kubebuilder:validation:MaxLength=4096 | ||
// +kubebuilder:validation:Optional | ||
Body string `json:"body,omitempty"` |
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.
We may want to model the Istio/Envoy approach and support an enum value here instead:
message HTTPDirectResponse {
// Specifies the HTTP response status to be returned.
uint32 status = 1 [(google.api.field_behavior) = REQUIRED];
// Specifies the content of the response body. If this setting is omitted,
// no body is included in the generated response.
HTTPBody body = 2;
}
message HTTPBody {
oneof specifier {
// response body as a string
string string = 1;
// response body as base64 encoded bytes.
bytes bytes = 2;
}
}
…test Signed-off-by: timflannagan <[email protected]>
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
Signed-off-by: timflannagan <[email protected]>
projects/gateway2/translator/plugins/redirect/redirect_plugin.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/registry/plugin_registry.go
Outdated
Show resolved
Hide resolved
…elegation e2e test Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
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.
Looks good! 🎉 Just had a couple questions!
projects/gateway2/translator/httproute/translate_httproute_test.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Show resolved
Hide resolved
test/kubernetes/e2e/features/directresponse/testdata/basic-delegation-direct-response.yaml
Show resolved
Hide resolved
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
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.
non-blocking final comments/questions
projects/gateway2/translator/httproute/translate_httproute_test.go
Outdated
Show resolved
Hide resolved
projects/gateway2/translator/plugins/directresponse/direct_response_plugin.go
Outdated
Show resolved
Hide resolved
Signed-off-by: timflannagan <[email protected]>
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.
looks good to me, great work!
})) | ||
Expect(routes[0].Matchers[0].PathSpecifier).To(Equal(&matchers.Matcher_Prefix{Prefix: "/"})) | ||
|
||
routeStatus := reportsMap.BuildRouteStatus(ctx, route, "") |
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.
we would also have ResolvedRefs false condition right?
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.
Yep, I'll do a fast follow that asserts on both the Accepted and ResolvedRef types. I think we'd want to do this for every test case throughout the suite.
Description
Introduces a new v1alpha1 DirectResponseRoute API to the Gloo project. This API allows GW API users to configure direct response functionality through the HTTPRoute resource via extensionRef:
Introducing this functionality helps bridge the gap between what's supported with the classic Edge APIs and the newer GW API integration. Long term, we plan to migrate users to the first-class functionality if upstream decides to adopt it.
Open Questions
backendRef.filters
configuration? Right now, that configuration is ignored by the implementation and no warning/error is bubbled up to the HTTPRoute statusAnswered Questions
TODO
API changes
Known Limitations
backendRef
or theRequestRedirect
filter in the same rule that references the DRR extension filter. In this case, the route will be replaced and produce an error on the HTTPRoute statusbackendRef.filters
field is currently unsupported and that configuration will be ignored by Gloo.crd:maxDescLen=0
controller-gen marker that disables this functionalityCode changes
Introduces a new route plugin that's responsible for translating DRR resources that are being referenced by valid HTTPRoute route rules. We discussed implementing this functionality directly in the HTTP route table translator, but decided against that approach since 1.) we implemented the redirect filter as a plugin, which also modifies the output route action, and 2.) we're implementing this functionality as an extension filter. Longer term, we can determine whether this approach is still feasible if upstream introduces this as a first-class route rule.
CI changes
Introduces a new test/kubernetes/e2e feature suite that runs through some basic use examples.
Docs changes
N/A. This is being tracked in https://github.com/solo-io/docs/issues/450.
Checklist: