-
Notifications
You must be signed in to change notification settings - Fork 618
feat: add RequestReply control plane #8701
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
feat: add RequestReply control plane #8701
Conversation
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
|
The broken builds/tests are coming from #8698 not being in yet - they should work once it is in |
|
/hold |
|
For testing (with the dependent PRs merged), I did:
func Handle(ctx context.Context, e event.Event) (*event.Event, error) {
/*
* YOUR CODE HERE
*
* Try running `go test`. Add more test as you code in `handle_test.go`.
*/
fmt.Println("Received event")
fmt.Println(e) // echo to local output
correlationId, ok := e.Extensions()["correlationid"]
if !ok {
fmt.Println("warning: failed to extract correlation id from event, reply may not be routed properly")
} else {
delete(e.Extensions(), "correlationid")
e.SetExtension("replyid", correlationId)
}
return &e, nil // echo to caller
}
apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
name: example
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: example
spec:
broker: example
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: echo-reply
filters:
- cesql: "EXISTS correlationid AND NOT EXISTS replyid"
---
apiVersion: eventing.knative.dev/v1alpha1
kind: RequestReply
metadata:
name: rr-test
spec:
brokerRef:
name: example
kind: Broker
apiVersion: eventing.knative.dev/v1Curl the request reply url within the cluster: kubectl run curl --image=docker.io/curlimages/curl --rm=true --restart=Never -ti \
-- -X POST -v \
-H "content-type: application/json" \
-H "ce-specversion: 1.0" \
-H "ce-source: my/curl/command" \
-H "ce-type: my.demo.event" \
-H "ce-id: 6cf17c7b-30b1-45a6-80b0-4cf58c92b947" \
-d '{"name":"Request Reply demo"}' \
http://request-reply.knative-eventing.svc.cluster.local/default/rr-test
If you don't see a command prompt, try pressing enter.
< HTTP/1.1 200 OK
< Allow: POST, OPTIONS
< Ce-Correlationid: 6cf17c7b-30b1-45a6-80b0-4cf58c92b947:N3RDobCYCVeP73fuzrXg1x4tYE2c3VkFAMqRADCM1uISFeKTvpKoN7L9YSrRMTvOKcbtQk1CGzvq5L3HEheAfw==:0
< Ce-Id: 6cf17c7b-30b1-45a6-80b0-4cf58c92b947
< Ce-Knativearrivaltime: 2025-09-02T21:38:07.133319085Z
< Ce-Replyid: 6cf17c7b-30b1-45a6-80b0-4cf58c92b947:N3RDobCYCVeP73fuzrXg1x4tYE2c3VkFAMqRADCM1uISFeKTvpKoN7L9YSrRMTvOKcbtQk1CGzvq5L3HEheAfw==:0
< Ce-Source: my/curl/command
< Ce-Specversion: 1.0
< Ce-Type: my.demo.event
< Content-Length: 29
< Content-Type: application/json
< Date: Tue, 02 Sep 2025 21:38:07 GMT
<
* Connection #0 to host request-reply.knative-eventing.svc.cluster.local left intact
{"name":"Request Reply demo"}pod "curl" deleted |
| deleteContext context.Context // used to delete triggers in a async cleanup operation | ||
| } | ||
|
|
||
| func (r *Reconciler) ReconcileKind(ctx context.Context, rr *v1alpha1.RequestReply) reconciler.Event { |
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.
can we have a test for the reconciler?
|
@Cali0707 Mind sharing the old feature track document for that ? |
Yeah - it is here https://docs.google.com/document/d/1vrCfIH9wRrsl8j7XpHK5XiVRgnx5nB4mLHsp0AxU_0Y/edit?usp=sharing @matzew |
Signed-off-by: Calum Murray <cmurray@redhat.com>
|
/cc @matzew |
Signed-off-by: Calum Murray <cmurray@redhat.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8701 +/- ##
==========================================
- Coverage 51.58% 50.19% -1.40%
==========================================
Files 401 409 +8
Lines 25446 26659 +1213
==========================================
+ Hits 13126 13381 +255
- Misses 11518 12436 +918
- Partials 802 842 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Calum Murray <cmurray@redhat.com>
Signed-off-by: Calum Murray <cmurray@redhat.com>
|
/unhold |
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.
Thanks @Cali0707
I tested it as (after rebased this PR) and it worked 🎉
Maybe we can add e2e tests for it as well (as a separate PR) and create issues to add TLS and auth support
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, creydr The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This adds the Request Reply control plane (as a first pass). In follow ups, TLS/authn/authz/observability/AES key rotation will be handled.
This depends on:
Proposed Changes