Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server/embed: address golangci var-naming issues #17674

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions server/embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ func init() {

// Config holds the arguments for configuring an etcd server.
type Config struct {
Name string `json:"name"`
Dir string `json:"data-dir"`
Name string `json:"name"`
Dir string `json:"data-dir"`
//revive:disable-next-line:var-naming
WalDir string `json:"wal-dir"`

SnapshotCount uint64 `json:"snapshot-count"`
Expand All @@ -163,7 +164,8 @@ type Config struct {
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`

MaxSnapFiles uint `json:"max-snapshots"`
MaxWalFiles uint `json:"max-wals"`
//revive:disable-next-line:var-naming
MaxWalFiles uint `json:"max-wals"`

// TickMs is the number of milliseconds between heartbeat ticks.
// TODO: decouple tickMs and heartbeat tick (current heartbeat tick = 1).
Expand Down Expand Up @@ -231,8 +233,11 @@ type Config struct {
CipherSuites []string `json:"cipher-suites"`

// TlsMinVersion is the minimum accepted TLS version between client/server and peers.
//revive:disable-next-line:var-naming
TlsMinVersion string `json:"tls-min-version"`

// TlsMaxVersion is the maximum accepted TLS version between client/server and peers.
//revive:disable-next-line:var-naming
TlsMaxVersion string `json:"tls-max-version"`

ClusterState string `json:"initial-cluster-state"`
Expand Down
8 changes: 4 additions & 4 deletions server/embed/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
)

func isMemberInitialized(cfg *Config) bool {
waldir := cfg.WalDir
if waldir == "" {
waldir = filepath.Join(cfg.Dir, "member", "wal")
walDir := cfg.WalDir
if walDir == "" {
walDir = filepath.Join(cfg.Dir, "member", "wal")
}
return wal.Exist(waldir)
return wal.Exist(walDir)
}
2 changes: 1 addition & 1 deletion server/etcdmain/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestConfigFileMemberFields(t *testing.T) {
yc := struct {
Dir string `json:"data-dir"`
MaxSnapFiles uint `json:"max-snapshots"`
MaxWalFiles uint `json:"max-wals"`
MaxWALFiles uint `json:"max-wals"`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a struct exclusively used in this test case. It tests that marshaling the JSON fields works as expected, feeding it as a YAML config file. So, it should be fine to rename this field

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

Name string `json:"name"`
SnapshotCount uint64 `json:"snapshot-count"`
SnapshotCatchUpEntries uint64 `json:"experimental-snapshot-catch-up-entries"`
Expand Down
Loading