refactor: parametrize PrefixFilter VersionType check

refs #34
This commit is contained in:
Christian Schwarz
2017-11-12 23:02:23 +01:00
parent cef63ac176
commit 51af880701
5 changed files with 21 additions and 17 deletions

View File

@ -46,7 +46,8 @@ func (p *Pruner) Run(ctx context.Context) (r []PruneResult, err error) {
log := log.WithField(logFSField, fs.ToString())
fsversions, err := zfs.ZFSListFilesystemVersions(fs, &PrefixSnapshotFilter{p.SnapshotPrefix})
snapshotFilter := NewTypedPrefixFilter(p.SnapshotPrefix, zfs.Snapshot)
fsversions, err := zfs.ZFSListFilesystemVersions(fs, snapshotFilter)
if err != nil {
log.WithError(err).Error("error listing filesytem versions")
continue