Describe the bug
Trigger's spec.attributes is a map[string]string, for exact matching with CloudEvents attributes. If the value of the attribute happens to look like a number (e.g. 42), then you cannot match it. As it is considered a number, which is never equal to a string.
Expected behavior
If spec.attributes is { the: "42" }, and I send a CloudEvent with an attribute in HTTP binary content mode with an HTTP header of ce-the: 42, then I expect the filter to match.
To Reproduce
apiVersion: eventing.knative.dev/v1alpha1
kind: Trigger
spec:
broker: default
filter:
attributes:
heart: "yes"
source: https://github.com/knative/eventing-sources/cmd/heartbeats/#event-test/mypod
the: "42"
type: dev.knative.eventing.samples.heartbeat
subscriber:
ref:
apiVersion: v1
kind: Service
name: event-display
---
apiVersion: sources.eventing.knative.dev/v1alpha1
kind: ContainerSource
metadata:
name: test-heartbeats
namespace: default
spec:
args:
- --period=1
env:
- name: POD_NAME
value: mypod
- name: POD_NAMESPACE
value: event-test
image: index.docker.io/daisyycguo/heartbeats-6790335e994243a8d3f53b967cdd6398
sink:
apiVersion: eventing.knative.dev/v1alpha1
kind: Broker
name: default
Describe the bug
Trigger's spec.attributes is a map[string]string, for exact matching with CloudEvents attributes. If the value of the attribute happens to look like a number (e.g.
42), then you cannot match it. As it is considered a number, which is never equal to a string.Expected behavior
If spec.attributes is
{ the: "42" }, and I send a CloudEvent with an attribute in HTTP binary content mode with an HTTP header ofce-the: 42, then I expect the filter to match.To Reproduce