1
0
Fork 0

feat: add default rule selector

This commit is contained in:
ssube 2019-06-30 21:03:12 -05:00
parent 93df975575
commit 15933ba620
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
6 changed files with 2 additions and 11 deletions

View File

@ -7,7 +7,6 @@ rules:
- ansible - ansible
- playbook - playbook
select: '$'
check: check:
type: array type: array
items: items:
@ -38,7 +37,6 @@ rules:
- ansible - ansible
- role - role
select: '$'
check: check:
type: array type: array
items: items:

View File

@ -7,7 +7,6 @@ rules:
- gitlab - gitlab
- optional - optional
select: '$'
check: check:
type: object type: object
required: [stages] required: [stages]
@ -24,7 +23,6 @@ rules:
- gitlab - gitlab
- optional - optional
select: '$'
check: check:
type: object type: object
patternProperties: patternProperties:
@ -42,7 +40,6 @@ rules:
- gitlab - gitlab
- important - important
select: '$'
check: check:
type: object type: object
patternProperties: patternProperties:

View File

@ -69,8 +69,6 @@ rules:
- grafana - grafana
- dashboard - dashboard
# 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: '$.dashboard' select: '$.dashboard'
filter: filter:

View File

@ -108,7 +108,6 @@ rules:
- kubernetes - kubernetes
- labels - labels
select: '$'
check: check:
type: object type: object
required: [metadata] required: [metadata]

View File

@ -10,7 +10,6 @@ definitions:
- level - level
- tags - tags
# data # data
- select
- check - check
properties: properties:
name: name:
@ -34,6 +33,7 @@ definitions:
pattern: "[-:a-z0-9]+" pattern: "[-:a-z0-9]+"
select: select:
type: string type: string
default: '$'
minLength: 1 minLength: 1
filter: filter:
type: object type: object
@ -59,7 +59,6 @@ rules:
- important - important
- salty-dog - salty-dog
select: '$'
check: check:
type: object type: object
additionalProperties: false additionalProperties: false

View File

@ -162,7 +162,7 @@ export class Rule implements RuleData, Visitor<RuleResult> {
this.desc = data.desc; this.desc = data.desc;
this.level = data.level; this.level = data.level;
this.name = data.name; this.name = data.name;
this.select = data.select; this.select = data.select || '$';
this.tags = Array.from(data.tags); this.tags = Array.from(data.tags);
// copy schema objects // copy schema objects