Trigger filtering based on cloud event headers

29 views
Skip to first unread message

Andrey Stelmashenko

unread,
Feb 23, 2022, 10:58:20 AMFeb 23
to Knative Users
Hi Community,

There is a filters feature of Triggers. Here is an example:
```
apiVersion: eventing.knative.dev/v1 kind: Trigger metadata: name: my-service-trigger spec: broker: default filter: attributes: type: dev.knative.foo.bar myextension: my-extension-value subscriber: ref: apiVersion: serving.knative.dev/v1 kind: Service name: my-service
```
Cloud events 'type' header is actually 'ce-type', how should I specify attributes 'type' or 'ce-type?'

Ahmed Abdalla

unread,
Feb 23, 2022, 11:15:43 AMFeb 23
to Andrey Stelmashenko, Knative Users
Hi Andrey

The Cloud Events Attribute is called "type" and that's what you should use. https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type

Thanks

--
Ahmed Abdalla


--
You received this message because you are subscribed to the Google Groups "Knative Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knative-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knative-users/2491e790-227f-4e4f-adb5-fa26b35b79f4n%40googlegroups.com.

Pierangelo Di Pilato

unread,
Feb 23, 2022, 11:36:04 AMFeb 23
to Andrey Stelmashenko, Knative Users
Hi Andrey,

it is any CloudEvent context attribute [1], in this case `type` (or
`myextension`).

[1]: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#attribute-naming-convention
> --
> You received this message because you are subscribed to the Google Groups "Knative Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to knative-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/knative-users/2491e790-227f-4e4f-adb5-fa26b35b79f4n%40googlegroups.com.


--

Pierangelo Di Pilato
Software Engineer
Red Hat, Inc
https://www.redhat.com/

Andrey Stelmashenko

unread,
Mar 15, 2022, 12:28:02 PMMar 15
to Knative Users
thank you for answers, I messed up with http headers.
Reply all
Reply to author
Forward
0 new messages