Remove version from RuleGroups

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2017-06-19 16:38:46 +05:30
parent 37e7b69f56
commit 592cb00c2f
No known key found for this signature in database
GPG Key ID: F1C217E8E9023CAD
12 changed files with 1 additions and 20 deletions

View File

@ -232,7 +232,6 @@ func updateRules(t cli.Term, filename string) error {
}
yamlRG := &rulefmt.RuleGroups{
Version: 1,
Groups: []rulefmt.RuleGroup{{
Name: filename,
}},

View File

@ -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 {

View File

@ -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",

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
rules:

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
rules:

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
rules:

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
- name: yolo

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
rules:

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
rules:

View File

@ -1,2 +0,0 @@
groups:
- name: yolo

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: yolo
rules:

View File

@ -1,4 +1,3 @@
version: 1
groups:
- name: my-group-name
interval: 30s # defaults to global interval