diff --git a/etcdmain/const_unix.go b/etcdmain/const_unix.go new file mode 100644 index 000000000..bfb0dfa44 --- /dev/null +++ b/etcdmain/const_unix.go @@ -0,0 +1,8 @@ +// +build !windows,!plan9 + +package etcdmain + +const ( + defaultMaxSnapshots = 5 + defaultMaxWALs = 5 +) diff --git a/etcdmain/const_windows.go b/etcdmain/const_windows.go new file mode 100644 index 000000000..608e83ae8 --- /dev/null +++ b/etcdmain/const_windows.go @@ -0,0 +1,8 @@ +// +build windows + +package etcdmain + +const ( + defaultMaxSnapshots = 0 + defaultMaxWALs = 0 +) diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go index ab6ea8500..22ff6ef4b 100644 --- a/etcdmain/etcd.go +++ b/etcdmain/etcd.go @@ -63,8 +63,8 @@ var ( snapCount = fs.Uint64("snapshot-count", etcdserver.DefaultSnapCount, "Number of committed transactions to trigger a snapshot") printVersion = fs.Bool("version", false, "Print the version and exit") forceNewCluster = fs.Bool("force-new-cluster", false, "Force to create a new one member cluster") - maxSnapFiles = fs.Uint("max-snapshots", 5, "Maximum number of snapshot files to retain (0 is unlimited)") - maxWalFiles = fs.Uint("max-wals", 5, "Maximum number of wal files to retain (0 is unlimited)") + maxSnapFiles = fs.Uint("max-snapshots", defaultMaxSnapshots, "Maximum number of snapshot files to retain (0 is unlimited)") + maxWalFiles = fs.Uint("max-wals", defaultMaxWALs, "Maximum number of wal files to retain (0 is unlimited)") initialCluster = fs.String("initial-cluster", "default=http://localhost:2380,default=http://localhost:7001", "Initial cluster configuration for bootstrapping") initialClusterToken = fs.String("initial-cluster-token", "etcd-cluster", "Initial cluster token for the etcd cluster during bootstrap")