zrepl/pruning/keep_not_replicated.go
Christian Schwarz d684302864 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.
2018-08-30 11:46:47 +02:00

16 lines
338 B
Go

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