mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl/ctlv3: fix snapshot command e2e tests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
b7ce6b7265
commit
ae9ccd883d
@ -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{
|
||||
|
@ -239,6 +239,7 @@ func (s *v3Manager) Restore(cfg RestoreConfig) error {
|
||||
}
|
||||
|
||||
srv := etcdserver.ServerConfig{
|
||||
Logger: s.lg,
|
||||
Name: cfg.Name,
|
||||
PeerURLs: pURLs,
|
||||
InitialPeerURLsMap: ics,
|
||||
|
@ -117,7 +117,6 @@ func snapshotStatusBeforeRestoreTest(cx ctlCtx) {
|
||||
"--data-dir", "snap.etcd",
|
||||
fpath),
|
||||
"added member")
|
||||
|
||||
if serr != nil {
|
||||
cx.t.Fatal(serr)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user