-
Notifications
You must be signed in to change notification settings - Fork 2
/
_telegram.selector
27 lines (27 loc) · 1.24 KB
/
_telegram.selector
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{{- define "render"}}{{$url := getVar "URL"}}{{printf $url (index . 0) (index . 1)}}{{"\n"}}{{end}}
{{- define "rules"}}
{{- if eq .type "K8sEvent"}}
{{- if not (.data.location | regexMatch "(kube-system.ack-controlplane-healthcheck)")}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_DEVOPS" | split "="}}{{template "render" $a}}
{{- end}}
{{- end}}
{{- if eq .type "GitlabEvent"}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_DEVOPS" | split "="}}{{template "render" $a}}
{{- end}}
{{- if eq .type "AlertmanagerEvent"}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_PLATFORM" | split "="}}{{template "render" $a}}
{{- end}}
{{- if eq .type "DataDogEvent"}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_PLATFORM" | split "="}}{{template "render" $a}}
{{- end}}
{{- if eq .type "Site24x7Event"}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_PLATFORM" | split "="}}{{template "render" $a}}
{{- end}}
{{- if eq .type "CloudflareEvent"}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_PLATFORM" | split "="}}{{template "render" $a}}
{{- end}}
{{- if eq .type "GoogleEvent"}}
{{$a := getEnv "EVENTS_TELEGRAM_OUT_BOT_PLATFORM" | split "="}}{{template "render" $a}}
{{- end}}
{{- end}}
{{- define "telegram-selector"}}{{template "rules" .}}{{end}}