eventing: Expression language for Trigger filter

Problem Now the Trigger filtering abilities are poor, because they require direct match on specific CloudEvent attributes.

Persona: User

Exit Criteria Trigger APIs should have a more powerful filtering abilities

Time Estimate (optional): 2

Additional context (optional) Together with @grantr we discussed the possibility to add an expression language to express the matching predicate. We need to find an expression language with implementations in different programming languages and that covers the basic string operations.

An example trigger could be:

apiVersion: eventing.knative.dev/v1beta1
kind: Trigger
metadata:
  name: my-service-trigger
spec:
  broker: default
  filter:
    predicate: my-extension-value == dev.knative.foo.bar || type == dev.knative.foo.bar
  subscriber:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: my-service

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 8
  • Comments: 30 (21 by maintainers)

Most upvoted comments

I’m totally on board with making the filter expressions more powerful. My $.02 is that this can be an additive (backwards compatible) change to the API and we do not have to get it in .16 where we bump the Trigger spec to v1.

wrt: javascript, I just can never remember how many = I have to specify to actually get the sane semantics 😃 jk