pruning: fix tests + implement 'not_replicated' and 'keep_regex' keep rule

tests expected that a KeepRule returns a *keep* list whereas it
actually returns a *destroy* list.
This commit is contained in:
Christian Schwarz
2018-08-30 11:44:43 +02:00
parent a2aa8e7bd7
commit d684302864
9 changed files with 134 additions and 43 deletions
+4 -4
View File
@@ -179,9 +179,9 @@ type PruneKeepLastN struct {
Count int `yaml:"count"`
}
type PruneKeepPrefix struct { // FIXME rename to KeepPrefix
Type string `yaml:"type"`
Prefix string `yaml:"prefix"`
type PruneKeepRegex struct { // FIXME rename to KeepRegex
Type string `yaml:"type"`
Regex string `yaml:"prefix"`
}
type LoggingOutletEnum struct {
@@ -301,7 +301,7 @@ func (t *PruningEnum) UnmarshalYAML(u func(interface{}, bool) error) (err error)
"not_replicated": &PruneKeepNotReplicated{},
"last_n": &PruneKeepLastN{},
"grid": &PruneGrid{},
"prefix": &PruneKeepPrefix{},
"prefix": &PruneKeepRegex{},
})
return
}