alerting icon indicating copy to clipboard operation
alerting copied to clipboard

Remove unused if in `default_template.go`

Open renepupil opened this issue 6 months ago • 3 comments

renepupil avatar May 05 '25 09:05 renepupil

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.

CLAassistant avatar May 05 '25 09:05 CLAassistant

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 avatar May 05 '25 09:05 renepupil

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

renepupil avatar May 05 '25 09:05 renepupil