mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-26 08:58:49 +01:00
prune: use zfs destroy with sanity check
This commit is contained in:
parent
fee2071514
commit
4a00bef40b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user