From 892f7e02e054a425ec64bb3e6e0a15ab742424f7 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Fri, 18 May 2018 14:39:31 -0700 Subject: [PATCH] etcdmain: rename "SnapshotCount" Signed-off-by: Gyuho Lee --- etcdmain/config.go | 2 +- etcdmain/config_test.go | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/etcdmain/config.go b/etcdmain/config.go index c969e8a16..43b1d094d 100644 --- a/etcdmain/config.go +++ b/etcdmain/config.go @@ -150,7 +150,7 @@ func newConfig() *config { fs.UintVar(&cfg.ec.MaxSnapFiles, "max-snapshots", cfg.ec.MaxSnapFiles, "Maximum number of snapshot files to retain (0 is unlimited).") fs.UintVar(&cfg.ec.MaxWalFiles, "max-wals", cfg.ec.MaxWalFiles, "Maximum number of wal files to retain (0 is unlimited).") fs.StringVar(&cfg.ec.Name, "name", cfg.ec.Name, "Human-readable name for this member.") - fs.Uint64Var(&cfg.ec.SnapCount, "snapshot-count", cfg.ec.SnapCount, "Number of committed transactions to trigger a snapshot to disk.") + fs.Uint64Var(&cfg.ec.SnapshotCount, "snapshot-count", cfg.ec.SnapshotCount, "Number of committed transactions to trigger a snapshot to disk.") fs.UintVar(&cfg.ec.TickMs, "heartbeat-interval", cfg.ec.TickMs, "Time (in milliseconds) of a heartbeat interval.") fs.UintVar(&cfg.ec.ElectionMs, "election-timeout", cfg.ec.ElectionMs, "Time (in milliseconds) for an election to timeout.") fs.BoolVar(&cfg.ec.InitialElectionTickAdvance, "initial-election-tick-advance", cfg.ec.InitialElectionTickAdvance, "Whether to fast-forward initial election ticks on boot for faster election.") diff --git a/etcdmain/config_test.go b/etcdmain/config_test.go index ef202a417..56d3f60dc 100644 --- a/etcdmain/config_test.go +++ b/etcdmain/config_test.go @@ -55,7 +55,7 @@ func TestConfigFileMemberFields(t *testing.T) { MaxSnapFiles uint `json:"max-snapshots"` MaxWalFiles uint `json:"max-wals"` Name string `json:"name"` - SnapCount uint64 `json:"snapshot-count"` + SnapshotCount uint64 `json:"snapshot-count"` LPUrls string `json:"listen-peer-urls"` LCUrls string `json:"listen-client-urls"` AcurlsCfgFile string `json:"advertise-client-urls"` @@ -513,13 +513,13 @@ func mustCreateCfgFile(t *testing.T, b []byte) *os.File { func validateMemberFlags(t *testing.T, cfg *config) { wcfg := &embed.Config{ - Dir: "testdir", - LPUrls: []url.URL{{Scheme: "http", Host: "localhost:8000"}, {Scheme: "https", Host: "localhost:8001"}}, - LCUrls: []url.URL{{Scheme: "http", Host: "localhost:7000"}, {Scheme: "https", Host: "localhost:7001"}}, - MaxSnapFiles: 10, - MaxWalFiles: 10, - Name: "testname", - SnapCount: 10, + Dir: "testdir", + LPUrls: []url.URL{{Scheme: "http", Host: "localhost:8000"}, {Scheme: "https", Host: "localhost:8001"}}, + LCUrls: []url.URL{{Scheme: "http", Host: "localhost:7000"}, {Scheme: "https", Host: "localhost:7001"}}, + MaxSnapFiles: 10, + MaxWalFiles: 10, + Name: "testname", + SnapshotCount: 10, } if cfg.ec.Dir != wcfg.Dir { @@ -534,8 +534,8 @@ func validateMemberFlags(t *testing.T, cfg *config) { if cfg.ec.Name != wcfg.Name { t.Errorf("name = %v, want %v", cfg.ec.Name, wcfg.Name) } - if cfg.ec.SnapCount != wcfg.SnapCount { - t.Errorf("snapcount = %v, want %v", cfg.ec.SnapCount, wcfg.SnapCount) + if cfg.ec.SnapshotCount != wcfg.SnapshotCount { + t.Errorf("snapcount = %v, want %v", cfg.ec.SnapshotCount, wcfg.SnapshotCount) } if !reflect.DeepEqual(cfg.ec.LPUrls, wcfg.LPUrls) { t.Errorf("listen-peer-urls = %v, want %v", cfg.ec.LPUrls, wcfg.LPUrls)