feat: add default rule selector
This commit is contained in:
parent
93df975575
commit
15933ba620
|
@ -7,7 +7,6 @@ rules:
|
|||
- ansible
|
||||
- playbook
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: array
|
||||
items:
|
||||
|
@ -38,7 +37,6 @@ rules:
|
|||
- ansible
|
||||
- role
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: array
|
||||
items:
|
||||
|
|
|
@ -7,7 +7,6 @@ rules:
|
|||
- gitlab
|
||||
- optional
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: object
|
||||
required: [stages]
|
||||
|
@ -24,7 +23,6 @@ rules:
|
|||
- gitlab
|
||||
- optional
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: object
|
||||
patternProperties:
|
||||
|
@ -42,7 +40,6 @@ rules:
|
|||
- gitlab
|
||||
- important
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: object
|
||||
patternProperties:
|
||||
|
|
|
@ -69,8 +69,6 @@ rules:
|
|||
- grafana
|
||||
- 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'
|
||||
|
||||
filter:
|
||||
|
|
|
@ -108,7 +108,6 @@ rules:
|
|||
- kubernetes
|
||||
- labels
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: object
|
||||
required: [metadata]
|
||||
|
|
|
@ -10,7 +10,6 @@ definitions:
|
|||
- level
|
||||
- tags
|
||||
# data
|
||||
- select
|
||||
- check
|
||||
properties:
|
||||
name:
|
||||
|
@ -34,6 +33,7 @@ definitions:
|
|||
pattern: "[-:a-z0-9]+"
|
||||
select:
|
||||
type: string
|
||||
default: '$'
|
||||
minLength: 1
|
||||
filter:
|
||||
type: object
|
||||
|
@ -59,7 +59,6 @@ rules:
|
|||
- important
|
||||
- salty-dog
|
||||
|
||||
select: '$'
|
||||
check:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
|
|
@ -162,7 +162,7 @@ export class Rule implements RuleData, Visitor<RuleResult> {
|
|||
this.desc = data.desc;
|
||||
this.level = data.level;
|
||||
this.name = data.name;
|
||||
this.select = data.select;
|
||||
this.select = data.select || '$';
|
||||
this.tags = Array.from(data.tags);
|
||||
|
||||
// copy schema objects
|
||||
|
|
Loading…
Reference in New Issue