mirror of
https://github.com/zrepl/zrepl.git
synced 2025-08-19 03:06:02 +02:00
cmd: noprune prune policy
This commit is contained in:
@@ -167,6 +167,8 @@ func parsePrunePolicy(v map[string]interface{}) (p PrunePolicy, err error) {
|
|||||||
switch policyName {
|
switch policyName {
|
||||||
case "grid":
|
case "grid":
|
||||||
return parseGridPrunePolicy(v)
|
return parseGridPrunePolicy(v)
|
||||||
|
case "noprune":
|
||||||
|
return NoPrunePolicy{}, nil
|
||||||
default:
|
default:
|
||||||
err = errors.Errorf("unknown policy '%s'", policyName)
|
err = errors.Errorf("unknown policy '%s'", policyName)
|
||||||
return
|
return
|
||||||
|
11
cmd/config_prune_none.go
Normal file
11
cmd/config_prune_none.go
Normal 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
|
||||||
|
}
|
Reference in New Issue
Block a user