cmd: noprune prune policy

This commit is contained in:
Christian Schwarz 2017-09-13 23:46:15 +02:00
parent e2149de840
commit 5faafbb1b4
2 changed files with 13 additions and 0 deletions

View File

@ -167,6 +167,8 @@ func parsePrunePolicy(v map[string]interface{}) (p PrunePolicy, err error) {
switch policyName {
case "grid":
return parseGridPrunePolicy(v)
case "noprune":
return NoPrunePolicy{}, nil
default:
err = errors.Errorf("unknown policy '%s'", policyName)
return

11
cmd/config_prune_none.go Normal file
View File

@ -0,0 +1,11 @@
package cmd
import "github.com/zrepl/zrepl/zfs"
type NoPrunePolicy struct{}
func (p NoPrunePolicy) Prune(fs *zfs.DatasetPath, versions []zfs.FilesystemVersion) (keep, remove []zfs.FilesystemVersion, err error) {
keep = versions
remove = []zfs.FilesystemVersion{}
return
}