This to prevent collisions between different event attributes.
For example when first an event with revision `foo` is received
without a token, after which a token `foo` is received without a
revision.
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
Introduce the flag `--no-cross-namespace-refs` (defaults to false) for allowing cluster admins to disable cross-namespace event sources for alerts.
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This adds some scaffolding for testing that events are forwarded as
specified by alerts.
The controllers themselves aren't needed; but since the
internal/server package refer directly to Kubernetes resources, the
tests share prerequisites with controller tests. For that reason I
have started by putting these tests in controllers/.
I have tried not to touch the server code itself, but it was necessary
to change it to use a fresh http.ServerMux rather than the (global)
default, so that the tests can create an event server each.
Signed-off-by: Michael Bridgen <michael@weave.works>