Reconcile EventTypes within Source Duck controller #2770
Conversation
|
@nachocano: GitHub didn't allow me to assign the following users: would, to, your, input, be, great, have. Note that only knative members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. DetailsIn 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. |
mattmoor
left a comment
There was a problem hiding this comment.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
mattmoor
left a comment
There was a problem hiding this comment.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
|
ping... |
# Conflicts: # Gopkg.lock
mattmoor
left a comment
There was a problem hiding this comment.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
mattmoor
left a comment
There was a problem hiding this comment.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
# Conflicts: # Gopkg.lock
|
Two changes I would like to see:
|
OK, will do! Thanks for reviewing Scott! |
|
The following is the coverage report on the affected files.
|
|
Changes done, RFAL |
|
nice work, looks real good. This will clean up a lot of controllers. 👍 /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: n3wscott, nachocano 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 |
Fixes #2484
Proposed Changes
🧽Creating a Source CRD reconciler that reconciles CRDs with the
duck.knative.dev/source="true"label. This reconciler is in charge of dynamically creating controllers for a particular GVR.🧽Creating a Source duck reconciler, which is dynamically created by the CRD one mentioned above, that reconciles
duckv1.Sourceresources with a particular GVR. It currently creates their EventTypes but in the future it can do more things.In order to do this I needed to change the
duckv1.SourceStatusto also contain a CloudEventAttributes list. This might be the most controversial change and I'm fully open for feedback. I couldn't just set the ceSource in the Status, because different Sources do different things. For example, theGithubSourceallows you to select a subset of the eventTypes listed in the CRD (thus we need the ceTypes information as well and cannot just rely on the CRD registry annotation). TheKafkaSourcemay contain multiple ceSources, e.g., if you specify two topics then the data plane constructs the ceSource based on the msg.Topic. In some Google Sources, we do not event know the ceSource at control-plane time, but rather on the data plane (thus I made eventType.spec.source optional), etc. To have a better idea of what I'm talking about, please refer Removing EventType dependency from eventing-contrib eventing-contrib#1036 in eventing-contrib. Also, here is the pkg PR Updating duckv1.SourceStatus to include CloudEventAttributes pkg#1165Added some TODOs in the code so that they are properly revisited once we address Improve EventType Registry #2750. IMO these changes puts us in a much better position for revisiting EventType. Also I made some mandatory parameters from EventType optional as well (not breaking change).
Added E2E tests for both ApiServerSource and PingSource.
Still missing some UTs, planning on adding them in a follow up...
Ack to @n3wscott for his autotrigger and discovery magic. This is basically the former.
Release Note
Docs
/assign @lionelvillard @vaikas @n3wscott @mattmoor @mikehelmick would be great to have your input