Skip to content

Remove unused if in default_template.go#322

Open
renepupil wants to merge 1 commit intografana:mainfrom
renepupil:patch-1
Open

Remove unused if in default_template.go#322
renepupil wants to merge 1 commit intografana:mainfrom
renepupil:patch-1

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