-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for notification templates #195
Comments
This might work but would mean opening up the go template pandoras box which will be difficult to close if it turns out it does not work. We would need to standardize which variables are exposed, which may lead to feature creep as users ask for more and more features in the templating. Saying that I am more in support of this feature than I am against. I think implementing this might solve #194. |
Wanted to throw some support on this. I think since already there is a well defined data object ( What I'd suggest is that the first implementation of this exposes this object for templating support. |
Glad to see others are in favor of this. |
I, too, would love to have a little bit more flexibility in constructing the message sent to Slack: we use the same channel for all notifications from our various environments (dev, QA, Staging and Prod) and if the message is always
Would it be possible to add at least some info on the cluster, from which the event was emitted? |
@hkuersten There is a |
It would also be nice to be able to customize the body being sent when using the I was hoping that using the Edit: For GitHub |
This feels like an essential feature for the notification controller. The Github actions solved this nicely with the |
UP! At image Update Automation I want modify template.. imageupdateautomation/flux-system.review
Committed and pushed change 2a70b3c6b39e2214e26ed3f5dae9999f2466526f to main
Images:
XXXXXXXX.com.br/api-arquivo/review:0.4.2-2 I wanted the result to be like this: helmrelease/api-arquivo.review
Helm upgrade has started
revision
0.3.3
Image
XXXXXXXX.com.br/api-arquivo/review:0.4.2-2 I already tried using summary and eventMetadata: helmrelease/api-arquivo.review
Helm upgrade succeeded
revision
0.2.8
summary
{{- with index .Event.Metadata "images" -}}
{{- $tag := last (split ":" (index . 0)) -}}
{{- printf "Upgrade %s/%s %s %s." .Values.namespace .Values.nameApp (index .Event.InvolvedObject.Fields "revision") $tag }} Still without success, does anyone have any idea how to link the image being updated in the helmRelease message? this in a single message? |
I'd very much love being able to template the payload, especially for "generic webhook", because that would open up lots of integrations, e.g. things like sending deployment markers to Honeycomb, setting the currently deployed version in something like Bugsnag, and so on. Having to implement each of those as a custom provider seems (to me at least) to be much more effort than should be necessary. (Also, I'd guess that quite a few of which currently are specialized providers, looking at something like Grafana, for example, could then just as well be "generic webhook" with an appropriate template instead of custom code.) |
When working with a notification, an established format has been created, which doesn't provide much flexibility in the message notification.
This is especially relevant for notifiers that support markdown, yet it's set to a default of
text
:https://github.com/fluxcd/notification-controller/blob/main/internal/notifier/discord.go#L96
https://github.com/fluxcd/notification-controller/blob/main/internal/notifier/rocket.go#L88
https://github.com/fluxcd/notification-controller/blob/main/internal/notifier/slack.go#L109
Can we create some common template struct to allow more flexibility in the message displayed?
The text was updated successfully, but these errors were encountered: