Duplicated EventTypes from sources with "auto create" enabled
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 631
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 6
Description
**Describe the bug**
when auto-create feature is enabled _and_ I use build-in sources, I get each event twice:
* one occrance from the source/duck reconciler (ownerReference: the source)
* one from the broker (ownerReference: the broker that received it)
See:
```
k get eventtypes.eventing.knative.dev -A
NAMESPACE NAME TYPE SOURCE SCHEMA REFERENCE NAME REFERENCE KIND DESCRIPTION READY REASON
default 0869e4f870fe6756b8709a84bd4704d1 dev.knative.sources.ping /apis/v1/namespaces/default/pingsources/ping-source-two my-broker Broker True
default 528a923dba2997343e8260eb2f76fc10 dev.knative.sources.ping /apis/v1/namespaces/default/pingsources/ping-source-broker my-broker Broker True
default et-my-broker-28e4c32ad62d0d20c633fd923b016e9c dev.knative.sources.ping /apis/v1/namespaces/default/pingsources/ping-source-broker my-broker Broker Event Type auto-created by controller True
default et-my-broker-5ea16d24144025d9cd501232308ee51c dev.knative.sources.ping /apis/v1/namespaces/default/pingsources/ping-source-two my-broker Broker Event Type auto-created by controller True
```
There is a (complex/weird) definition of uniqueness, generally on `EventType`:
> In order to _uniquely_ identify an EventType, we would need to look at the tuple (`type`, `source`, `schema`, `broker`), as there might be EventTypes with the same `type` but different `sources`, or pointing to different `brokers`, and so on.
See https://github.com/knative/eventing/tree/main/docs/registry
Looking at the list above, that uniqueness (`type`, `source`, `schema`, `broker`), we still have each doubled (one by the auto-create and one from the duck). Perhaps we should check that, when doing the autocreate?
FWIW, the "source duck" created events do have the actual source (e.g. PingSource) as an owner
**Knative release version**
1.12
1.11
**Additional context**
Add any other context about the problem here such as proposed priority
Contributor guide
Assessment
This issue has not been assessed yet.