Browse code

Remove some redundant consts

Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>

yuexiao-wang authored on 2016/11/02 04:11:38
Showing 3 changed files
... ...
@@ -14,13 +14,6 @@ import (
14 14
 	"github.com/spf13/pflag"
15 15
 )
16 16
 
17
-const (
18
-	generatedSecretEntropyBytes = 16
19
-	generatedSecretBase         = 36
20
-	// floor(log(2^128-1, 36)) + 1
21
-	maxGeneratedSecretLength = 25
22
-)
23
-
24 17
 type initOptions struct {
25 18
 	swarmOptions
26 19
 	listenAddr NodeAddrOption
... ...
@@ -46,7 +39,7 @@ func newInitCommand(dockerCli *command.DockerCli) *cobra.Command {
46 46
 	flags := cmd.Flags()
47 47
 	flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: <ip|interface>[:port])")
48 48
 	flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
49
-	flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state.")
49
+	flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state")
50 50
 	addSwarmFlags(flags, &opts.swarmOptions)
51 51
 	return cmd
52 52
 }
... ...
@@ -33,7 +33,7 @@ type swarmOptions struct {
33 33
 	externalCA          ExternalCAOption
34 34
 }
35 35
 
36
-// NodeAddrOption is a pflag.Value for listen and remote addresses
36
+// NodeAddrOption is a pflag.Value for listening addresses
37 37
 type NodeAddrOption struct {
38 38
 	addr string
39 39
 }
... ...
@@ -25,7 +25,7 @@ Options:
25 25
       --cert-expiry duration            Validity period for node certificates (default 2160h0m0s)
26 26
       --dispatcher-heartbeat duration   Dispatcher heartbeat period (default 5s)
27 27
       --external-ca value               Specifications of one or more certificate signing endpoints
28
-      --force-new-cluster               Force create a new cluster from current state.
28
+      --force-new-cluster               Force create a new cluster from current state
29 29
       --help                            Print usage
30 30
       --listen-addr value               Listen address (format: <ip|interface>[:port])
31 31
       --task-history-limit int          Task history retention limit (default 5)