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:
@@ -0,0 +1,15 @@
|
||||
package pruning
|
||||
|
||||
type KeepNotReplicated struct {
|
||||
forceConstructor struct{}
|
||||
}
|
||||
|
||||
func (*KeepNotReplicated) KeepRule(snaps []Snapshot) (destroyList []Snapshot) {
|
||||
return filterSnapList(snaps, func(snapshot Snapshot) bool {
|
||||
return snapshot.Replicated()
|
||||
})
|
||||
}
|
||||
|
||||
func NewKeepNotReplicated() *KeepNotReplicated {
|
||||
return &KeepNotReplicated{}
|
||||
}
|
||||
Reference in New Issue
Block a user