Remove version from RuleGroups
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
parent
37e7b69f56
commit
592cb00c2f
|
@ -232,7 +232,6 @@ func updateRules(t cli.Term, filename string) error {
|
|||
}
|
||||
|
||||
yamlRG := &rulefmt.RuleGroups{
|
||||
Version: 1,
|
||||
Groups: []rulefmt.RuleGroup{{
|
||||
Name: filename,
|
||||
}},
|
||||
|
|
|
@ -37,7 +37,6 @@ func (err *Error) Error() string {
|
|||
|
||||
// RuleGroups is a set of rule groups that are typically exposed in a file.
|
||||
type RuleGroups struct {
|
||||
Version int `yaml:"version"`
|
||||
Groups []RuleGroup `yaml:"groups"`
|
||||
|
||||
// Catches all undefined fields and must be empty after parsing.
|
||||
|
@ -46,9 +45,6 @@ type RuleGroups struct {
|
|||
|
||||
// Validate validates all rules in the rule groups.
|
||||
func (g *RuleGroups) Validate() (errs []error) {
|
||||
if g.Version != 1 {
|
||||
errs = append(errs, errors.Errorf("invalid rule group version %d", g.Version))
|
||||
}
|
||||
set := map[string]struct{}{}
|
||||
|
||||
for _, g := range g.Groups {
|
||||
|
|
|
@ -37,10 +37,6 @@ func TestParseFileFailure(t *testing.T) {
|
|||
filename: "duplicate_grp.bad.yaml",
|
||||
errMsg: "groupname: \"yolo\" is repeated in the same file",
|
||||
},
|
||||
{
|
||||
filename: "noversion.bad.yaml",
|
||||
errMsg: "invalid rule group version 0",
|
||||
},
|
||||
{
|
||||
filename: "bad_expr.bad.yaml",
|
||||
errMsg: "parse error",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
rules:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
rules:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
rules:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
- name: yolo
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
rules:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
rules:
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
groups:
|
||||
- name: yolo
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: yolo
|
||||
rules:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
version: 1
|
||||
groups:
|
||||
- name: my-group-name
|
||||
interval: 30s # defaults to global interval
|
||||
|
|
Loading…
Reference in New Issue