-
Notifications
You must be signed in to change notification settings - Fork 43
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
Accept template contents as strings instead of reading from disk #161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! A couple of comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I do not think that there is anything else to do because we do not let users to override the files on the disc. According to the code https://github.com/grafana/grafana/blob/a564c8c4398fe2a763712fa54e21885017151b45/pkg/services/ngalert/notifier/config.go#L25-L54 we always override the content of the files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - my comments are nits and I don't need to look at this again.
Updates Grafana Alertmanager to work with new interface from grafana/alerting#161. This change stops passing user-defined templates to the Grafana Alertmanager by persisting them to disk and instead passes them by string.
What is this feature?
Makes use of the new upstream
Template.New()
to stop passing user-defined templates to the Grafana Alertmanager by persisting them to disk.Why do we need this feature?
This PR is a general improvement and simplification, but there are also some specific reasons why we might want to do this:
FileStore
.DefaultTemplateString
is now treated like other defaults and therefor consistently applied first. This ensures that user-defined templates can now rely on being able to override defaults.Future improvements
default.tmpl
andemail.tmpl
) to strings as well, allowing them to be more easily overridden via API/UI.