diff --git a/etcdctl/ctlv3/command/snapshot_command.go b/etcdctl/ctlv3/command/snapshot_command.go index 22703feeffe..045ae5645bc 100644 --- a/etcdctl/ctlv3/command/snapshot_command.go +++ b/etcdctl/ctlv3/command/snapshot_command.go @@ -95,14 +95,10 @@ func snapshotSaveCommandFunc(cmd *cobra.Command, args []string) { ExitWithError(ExitBadArgs, err) } - debug, err := cmd.Flags().GetBool("debug") + lg, err := zap.NewProduction() if err != nil { ExitWithError(ExitError, err) } - lg := zap.NewNop() - if debug { - lg = zap.NewExample() - } sp := snapshot.NewV3(lg) cfg := mustClientCfgFromCmd(cmd) @@ -120,14 +116,10 @@ func snapshotStatusCommandFunc(cmd *cobra.Command, args []string) { } initDisplayFromCmd(cmd) - debug, err := cmd.Flags().GetBool("debug") + lg, err := zap.NewProduction() if err != nil { ExitWithError(ExitError, err) } - lg := zap.NewNop() - if debug { - lg = zap.NewExample() - } sp := snapshot.NewV3(lg) ds, err := sp.Status(args[0]) if err != nil { @@ -152,14 +144,10 @@ func snapshotRestoreCommandFunc(cmd *cobra.Command, args []string) { walDir = filepath.Join(dataDir, "member", "wal") } - debug, err := cmd.Flags().GetBool("debug") + lg, err := zap.NewProduction() if err != nil { ExitWithError(ExitError, err) } - lg := zap.NewNop() - if debug { - lg = zap.NewExample() - } sp := snapshot.NewV3(lg) if err := sp.Restore(snapshot.RestoreConfig{ diff --git a/snapshot/v3_snapshot.go b/snapshot/v3_snapshot.go index 6a3a504d652..df8c3571643 100644 --- a/snapshot/v3_snapshot.go +++ b/snapshot/v3_snapshot.go @@ -239,6 +239,7 @@ func (s *v3Manager) Restore(cfg RestoreConfig) error { } srv := etcdserver.ServerConfig{ + Logger: s.lg, Name: cfg.Name, PeerURLs: pURLs, InitialPeerURLsMap: ics, diff --git a/tests/e2e/ctl_v3_snapshot_test.go b/tests/e2e/ctl_v3_snapshot_test.go index 79e601239a2..f38b1cdbea0 100644 --- a/tests/e2e/ctl_v3_snapshot_test.go +++ b/tests/e2e/ctl_v3_snapshot_test.go @@ -117,7 +117,6 @@ func snapshotStatusBeforeRestoreTest(cx ctlCtx) { "--data-dir", "snap.etcd", fpath), "added member") - if serr != nil { cx.t.Fatal(serr) }