Skip to content

Remove unused if in default_template.go #322

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renepupil
Copy link

No description provided.

@renepupil renepupil requested a review from a team as a code owner May 5, 2025 09:42
@github-project-automation github-project-automation bot moved this to In review in Alerting May 5, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@renepupil
Copy link
Author

renepupil commented May 5, 2025

I strongly suggest splitting the template into multiple lines, just like regular code:

{{- define "default.message" -}}
    {{- if gt (len .Alerts.Firing) 0 -}}
        **Firing**
        {{- template "__text_alert_list" .Alerts.Firing -}}
    {{- end -}}
    {{- if gt (len .Alerts.Resolved) 0 -}}
        **Resolved**
        {{- template "__text_alert_list" .Alerts.Resolved -}}
    {{- end -}}
{{- end -}}

@renepupil
Copy link
Author

MEMO: Same also in {{- define "teams.default.message" -}} block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants