-
Notifications
You must be signed in to change notification settings - Fork 420
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
Use knative "adapter" to simplify event listener sink #1207
Conversation
The following is the coverage report on the affected files.
|
Ha, it looks like this is actually consumed, by a little function in /hold I may try to expand this PR to drop the config-logging propagation altogether, since we can probably get away with env/flags and it will greatly simplify the mechanics of EventListener. |
7346475
to
b512015
Compare
The following is the coverage report on the affected files.
|
b512015
to
1b85679
Compare
The following is the coverage report on the affected files.
|
1b85679
to
54f7063
Compare
The following is the coverage report on the affected files.
|
54f7063
to
a3ad842
Compare
The following is the coverage report on the affected files.
|
/retest |
a3ad842
to
1b4c9c8
Compare
The following is the coverage report on the affected files.
|
1b4c9c8
to
e16cb83
Compare
The following is the coverage report on the affected files.
|
/retest |
1 similar comment
/retest |
e16cb83
to
f093de6
Compare
The
Adding a sleep to see if that helps... |
@n3wscott: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -25,5 +32,15 @@ func WithClient(client dynamic.Interface) clientset.Option { | |||
cs.Add(r, client) | |||
} | |||
} | |||
for version, resources := range allowedTriggersTypes { |
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.
Do we need TriggersType here? @dibyom
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.
This is needed to pass now, since everything is going over the dynamic client now.
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.
If everything is going over the dynamic client now, can we get rid of the typed clientsets in the Sink struct?
https://github.com/tektoncd/triggers/blob/main/pkg/sink/sink.go#L50-L51
The following is the coverage report on the affected files.
|
/hold cancel |
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 @mattmoor ! The EL initialization code looks much simpler!
I'm like halfway through this PR at the moment and will try this out on my local setup.
Are there any docs around the eventing adapter library that I can use to understand what it provides better?
Also, it looks like we've added a lott of files to vendor/ Are all of them needed? e.g. I found vendor/k8s.io/client-go/applyconfigurations/networking/v1/networkpolicyport.go etc.
"v1beta1": {"pipelineruns", "taskruns", "pipelines", "clustertasks", "tasks"}, | ||
} | ||
allowedTriggersTypes = map[string][]string{ | ||
"v1alpha1": {"clusterinterceptors"}, |
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.
Do we also need to add "clustertriggerbindings", "eventlisteners", "triggerbindings", "triggers", "triggertemplates"
here ?
/cc @dibyom
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.
I can for completeness, but given the way this access control works, it is not needed to pass tests. You only need the exact versions through which the code accesses things.
@n3wscott or @lionelvillard might have a pointer, not sure.
I think this is related to the K8s API adding server-side apply in the latest client update that knative/pkg pulls in. |
The following is the coverage report on the affected files.
|
This is a good starting point: https://github.com/knative/eventing/tree/main/docs/source#receive-adapters |
The following is the coverage report on the affected files.
|
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.
Looking good. Could we also get rid of the typed clients now that everything is going over the dynamic clientset?
@@ -90,12 +90,16 @@ port_forward_and_curl() { | |||
exit 1 | |||
fi | |||
|
|||
# Wait a few seconds for resources to show up | |||
sleep 3 |
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 already wait for the EL to be ready in the check_eventlistener function. Do we also need the sleep?
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.
This is waiting for the EL to materialize the TaskRuns and PipelineRuns before querying them below.
i was seeing intermittent flakes without this.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dibyom The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The typed clients (and objects) are much nicer to deal with directly, this just tunnels them through the dynamic client. |
/lgtm Nice! |
/kind cleanup
This simplifies the event listener sink by adopting the knative eventing "adapter" library, which is like our sharedmain for controlplanes, but for the eventing dataplane components. This pattern passes config data as JSON in
env:
, so it also dramatically simplifies the controller logic because we no longer need to copy around empty configmaps and clean them up, and net removes a lot of code.This also takes advantage of the new dynamic client injection logic to reduce the overhead of each adapter on the API server, and potentially dramatically improves cold start time of ksvc based sinks (they no longer need to sync informers to handle traffic). If this proves troublesome, it should be relatively straightforward to switch things back.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes