Remove version from RuleGroups

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
pull/2842/head
Goutham Veeramachaneni 8 years ago
parent 37e7b69f56
commit 592cb00c2f
No known key found for this signature in database
GPG Key ID: F1C217E8E9023CAD

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

@ -37,8 +37,7 @@ 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"`
Groups []RuleGroup `yaml:"groups"`
// Catches all undefined fields and must be empty after parsing.
XXX map[string]interface{} `yaml:",inline"`
@ -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…
Cancel
Save