From 4a00bef40b308a135ed6b1772157989c9857a592 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 1 Sep 2017 17:09:54 +0200 Subject: [PATCH] prune: use zfs destroy with sanity check --- cmd/prune.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/prune.go b/cmd/prune.go index b305a84..399c16f 100644 --- a/cmd/prune.go +++ b/cmd/prune.go @@ -2,12 +2,13 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" - "github.com/zrepl/zrepl/util" - "github.com/zrepl/zrepl/zfs" "os" "sort" "time" + + "github.com/spf13/cobra" + "github.com/zrepl/zrepl/util" + "github.com/zrepl/zrepl/zfs" ) var pruneArgs struct { @@ -121,7 +122,7 @@ func doPrune(ctx PruneContext, log Logger) error { // special handling for EBUSY (zfs hold) // error handling for clones? just echo to cli, skip over, and exit with non-zero status code (we're idempotent) if !ctx.DryRun { - err := zfs.ZFSDestroy(r.ToAbsPath(fs)) + err := zfs.ZFSDestroyFilesystemVersion(fs, r.FilesystemVersion) if err != nil { // handle log.Printf("error: %s", err)