Skip to content
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

Auto Enabled Events only show up for InMemory channel #7154

Closed
matzew opened this issue Aug 7, 2023 · 6 comments · Fixed by #7161
Closed

Auto Enabled Events only show up for InMemory channel #7154

matzew opened this issue Aug 7, 2023 · 6 comments · Fixed by #7161
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@matzew
Copy link
Member

matzew commented Aug 7, 2023

Describe the bug

Create a broker like:

apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
  namespace: default
  name: my-broker

and than send some random event to it, like:

kn-event-linux-amd64 send \
  --to Broker:eventing.knative.dev/v1:my-broker\
  --type com.corp.integration.warning \
  -f message="fooss"

You will not see an EventType for the broker: just the channel. However, the channel is just an implementation detail, and is OK that it is listed there, on the ingress, but for sure it should also show this for the Broker.

Result:

k get eventtypes.eventing.knative.dev -A  
NAMESPACE   NAME                                  TYPE                           SOURCE            SCHEMA   REFERENCE NAME          REFERENCE KIND    DESCRIPTION                             READY   REASON
default     et-my-broker-kne-trigger-y29tlmnvcn   com.corp.integration.warning   kn-event/v1.9.0            my-broker-kne-trigger   InMemoryChannel   Event Type auto-created by controller   True    
@matzew matzew added the kind/bug Categorizes issue or PR as related to a bug. label Aug 7, 2023
@matzew
Copy link
Member Author

matzew commented Aug 7, 2023

Actually:

If events are routed to a channel created/owned by the broker controller, we should not create these event types

@dsimansk
Copy link
Contributor

dsimansk commented Aug 9, 2023

@matzew pls do you have a quick hint where is the routing happening to check if we can infer the ownership?

@Cali0707
Copy link
Member

Cali0707 commented Aug 9, 2023

@dsimansk are you working on this? If not, I can take it :)

@dsimansk
Copy link
Contributor

dsimansk commented Aug 9, 2023

@Cali0707 go ahead I was just poking around, but haven't found a good starting point. :)

@Cali0707
Copy link
Member

Cali0707 commented Aug 9, 2023

/assign

@Cali0707
Copy link
Member

Cali0707 commented Aug 9, 2023

@matzew it looks like this is happening because the TypeMeta is not properly set on the Broker object used in the ingress_handler.go. The TypeMeta is always initially set correctly, however after the first call to getBroker

func (h *Handler) getChannelAddress(name, namespace string) (*duckv1.Addressable, error) {
broker, err := h.getBroker(name, namespace)
if err != nil {
return nil, err
}

the Broker object stored in the indexer changes to have no TypeMeta set, so when we access the broker object when creating events there is no TypeMeta anymore. Also, on subsequent http requests, there is no TypeMeta - only on the first request it is set.

Temporarily, we can fix this by just hardcoding the TypeMeta, but I think we should try and figure out what the problem is - WDYT?

@lberk lberk changed the title Auto Enabled Events only show up for InMemroy channe Auto Enabled Events only show up for InMemory channel Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants