Open bradmccoydev opened 2 years ago
Notes from Flux community meeting 11-Aug. We will investigate alternative ways of doing this and look into transforming a Kubernetes event into a Cloudevent and how we add our custom metadata. @bradmccoydev to investigate further, and see if anyone else is doing this.
Hey @bradmccoydev, did you get to take a look at this? I'd be happy to pair up on this effort. Find me on Slack as @max
.
Hey @makkes sorry I haven't yet, it got stale, but still very interested. That sounds great I will reach out, is that CNCF slack right?
is that CNCF slack right?
yes, it is.
This is a feature request to add the ability to send a CloudEvent / CDEvent from a flux notification to enable better interoperability between tools such as Keptn or Tekton for example.
This issue relates to #195 we can either update the forwarder notifier or create a new notifier for events.
The easiest and most likely accepted way of doing this is as follows:
Extend the Provider secret to contain a Body Template for the HTTP request. As we are already getting the secret.Data it is easy to reference the "body" and pull it the same way we get the headers and address.
Now that we have the Body template we need the key-value pairs of the metadata we require to substitute the template. This can be passed through the Provider.Metadata.Labels, as we are already pulling the provider object and Labels, is a mandatory field that can be used for the key values.
Use basic go text/template to switch out these values in the body from the secret.
Please find below an example
1.
2.
3.
I'm happy to do a PR to demonstrate this if it will be accepted. Thanks