From f9e2b6818e84ce8322db8473e9c4701ef76f53e0 Mon Sep 17 00:00:00 2001 From: ssube Date: Wed, 26 Jun 2019 07:46:55 -0500 Subject: [PATCH] lint(rules): make production alerts selector more specific --- rules/grafana.yml | 50 +++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/rules/grafana.yml b/rules/grafana.yml index ea31c4f..20a7e1c 100644 --- a/rules/grafana.yml +++ b/rules/grafana.yml @@ -9,41 +9,35 @@ rules: # this is not the ideal selector for this rule, but tags are located at $.dashboard.tags, while notification # channels are nested under $.dashboard.panels[*].alert.notifications[*].uid - select: '$' + select: '$.dashboard' filter: type: object properties: - dashboard: - type: object - properties: - tags: - type: array - items: - type: string - contains: - pattern: production + tags: + type: array + items: + type: string + contains: + pattern: production check: type: object properties: - dashboard: - type: object - properties: - panels: - type: array - items: + panels: + type: array + items: + type: object + properties: + alert: type: object properties: - alert: - type: object - properties: - notifications: - type: array - items: - type: object - required: [uid] - properties: - uid: - type: string - pattern: production \ No newline at end of file + notifications: + type: array + items: + type: object + required: [uid] + properties: + uid: + type: string + pattern: production \ No newline at end of file