feat: add default rule selector
This commit is contained in:
parent
93df975575
commit
15933ba620
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -108,7 +108,6 @@ rules:
|
||||||
- kubernetes
|
- kubernetes
|
||||||
- labels
|
- labels
|
||||||
|
|
||||||
select: '$'
|
|
||||||
check:
|
check:
|
||||||
type: object
|
type: object
|
||||||
required: [metadata]
|
required: [metadata]
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue