From 457e448f9f572ff7e30bccd9bd668c441aaa34cc Mon Sep 17 00:00:00 2001 From: yuexiao-wang Date: Wed, 2 Nov 2016 03:11:38 +0800 Subject: [PATCH] Remove some redundant consts Signed-off-by: yuexiao-wang Upstream-commit: 6b412d4fd30afe2a24f66839a6c26fbc94b01493 Component: engine --- components/engine/cli/command/swarm/init.go | 9 +-------- components/engine/cli/command/swarm/opts.go | 2 +- .../engine/docs/reference/commandline/swarm_init.md | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/components/engine/cli/command/swarm/init.go b/components/engine/cli/command/swarm/init.go index 60fb8e8fe3..16f372f8d7 100644 --- a/components/engine/cli/command/swarm/init.go +++ b/components/engine/cli/command/swarm/init.go @@ -14,13 +14,6 @@ import ( "github.com/spf13/pflag" ) -const ( - generatedSecretEntropyBytes = 16 - generatedSecretBase = 36 - // floor(log(2^128-1, 36)) + 1 - maxGeneratedSecretLength = 25 -) - type initOptions struct { swarmOptions listenAddr NodeAddrOption @@ -46,7 +39,7 @@ func newInitCommand(dockerCli *command.DockerCli) *cobra.Command { flags := cmd.Flags() flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: [:port])") flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: [:port])") - flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state.") + flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state") addSwarmFlags(flags, &opts.swarmOptions) return cmd } diff --git a/components/engine/cli/command/swarm/opts.go b/components/engine/cli/command/swarm/opts.go index 58330b7f8a..3659b55f81 100644 --- a/components/engine/cli/command/swarm/opts.go +++ b/components/engine/cli/command/swarm/opts.go @@ -33,7 +33,7 @@ type swarmOptions struct { externalCA ExternalCAOption } -// NodeAddrOption is a pflag.Value for listen and remote addresses +// NodeAddrOption is a pflag.Value for listening addresses type NodeAddrOption struct { addr string } diff --git a/components/engine/docs/reference/commandline/swarm_init.md b/components/engine/docs/reference/commandline/swarm_init.md index 4c15aafb92..eb021fbe7b 100644 --- a/components/engine/docs/reference/commandline/swarm_init.md +++ b/components/engine/docs/reference/commandline/swarm_init.md @@ -25,7 +25,7 @@ Options: --cert-expiry duration Validity period for node certificates (default 2160h0m0s) --dispatcher-heartbeat duration Dispatcher heartbeat period (default 5s) --external-ca value Specifications of one or more certificate signing endpoints - --force-new-cluster Force create a new cluster from current state. + --force-new-cluster Force create a new cluster from current state --help Print usage --listen-addr value Listen address (format: [:port]) --task-history-limit int Task history retention limit (default 5)