mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-25 01:44:43 +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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/spf13/cobra"
|
|
||||||
"github.com/zrepl/zrepl/util"
|
|
||||||
"github.com/zrepl/zrepl/zfs"
|
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/zrepl/zrepl/util"
|
||||||
|
"github.com/zrepl/zrepl/zfs"
|
||||||
)
|
)
|
||||||
|
|
||||||
var pruneArgs struct {
|
var pruneArgs struct {
|
||||||
@ -121,7 +122,7 @@ func doPrune(ctx PruneContext, log Logger) error {
|
|||||||
// special handling for EBUSY (zfs hold)
|
// 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)
|
// error handling for clones? just echo to cli, skip over, and exit with non-zero status code (we're idempotent)
|
||||||
if !ctx.DryRun {
|
if !ctx.DryRun {
|
||||||
err := zfs.ZFSDestroy(r.ToAbsPath(fs))
|
err := zfs.ZFSDestroyFilesystemVersion(fs, r.FilesystemVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// handle
|
// handle
|
||||||
log.Printf("error: %s", err)
|
log.Printf("error: %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user