Filters provide a powerful mechanism to apply constraints on the events in order to determine a validity.
If filters determine an event is valid, this will trigger the action defined by the Sensor.
If filters determine an event is not valid, this won't trigger any action.
Argo Events offers 5 types of filters:
PLEASE NOTEthis is the order in which Sensor evaluates filter types: expr, data, context, time.
Filter types can be evaluated together in 2 ways:
and, meaning that all filters returning
trueare required for an event to be valid
or, meaning that only one filter returning
trueis enough for an event to be valid
Any kind of filter error is considered as
false (e.g. path not existing in event body).
Such behaviour can be configured with
filtersLogicalOperator field in a Sensor dependency, e.g.
apiVersion: argoproj.io/v1alpha1 kind: Sensor metadata: name: multiple-filters-example spec: dependencies: - name: sample-dependency eventSourceName: webhook eventName: sample-event filtersLogicalOperator: "or" filters: # ...
""(empty), defaulting to
and, default behaviour
PLEASE NOTELogical operator values must be
You can find some examples here.