Skip to content

Commit 48a4169

Browse files
author
Maurice Faber
committed
fix: alertmanager template [ci skip]
1 parent ed6b572 commit 48a4169

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

helmfile.d/snippets/alertmanager.gotmpl

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ global:
88
{{- if or (has "email" $receivers) (and .root.otomi.isHomeMonitored (has "email" $homeReceivers)) }}
99
smtp_smarthost: {{ .instance | get "alerts.email.smtp.smarthost" (.root | get "alerts.email.smtp.smarthost" (.root | get "home.email.smtp.smarthost" nil)) }}
1010
smtp_hello: {{ .instance | get "alerts.email.smtp.hello" (.root | get "alerts.email.smtp.hello" .root.cluster.domain) }}
11-
smtp_from: {{ .instance | get "alerts.email.smtp.from" (.root | get "alerts.email.smtp.from" (print "alerts@" .root.cluster.domain)) }}
11+
smtp_from: {{ .instance | get "alerts.email.smtp.from" (.root | get "alerts.email.smtp.from" (.root | get "home.email.smtp.from" (print "alerts@" .root.cluster.domain))) }}
1212
smtp_auth_username: {{ .instance | get "alerts.email.smtp.auth_username" (.root | get "alerts.email.smtp.auth_username" (.root | get "home.email.smtp.auth_username" nil)) }}
1313
smtp_auth_password: {{ .instance | get "alerts.email.smtp.auth_password" (.root | get "alerts.email.smtp.auth_password" (.root | get "home.email.smtp.auth_password" nil)) }}
1414
smtp_auth_secret: {{ .instance | get "alerts.email.smtp.auth_secret" (.root | get "alerts.email.smtp.auth_secret" (.root | get "home.email.smtp.auth_secret" nil)) }}
@@ -73,7 +73,7 @@ receivers:
7373
send_resolved: true
7474
{{- end }}
7575
{{- if has "email" $receivers }}
76-
{{- $criticalTo := .instance | get "alerts.email.critical" (.root | get "alerts.email.critical") }}
76+
{{- $criticalTo := .instance | get "alerts.email.critical" (.root | get "alerts.email.critical" nil) }}
7777
{{- if $criticalTo }}
7878
email_configs:
7979
- to: {{ $criticalTo }}
@@ -96,8 +96,10 @@ receivers:
9696
{{- end }}
9797
{{- if has "email" $receivers }}
9898
{{- $criticalTo := .root | get "home.email.critical" nil }}
99+
{{- if $criticalTo }}
99100
email_configs:
100101
- to: {{ $criticalTo }}
101102
send_resolved: true
103+
{{- end }}
102104
{{- end }}
103105
{{- end }}

0 commit comments

Comments
 (0)