Browse code

fix the type

Signed-off-by: yupengzte <yu.peng36@zte.com.cn>

yupengzte authored on 2017/02/08 17:31:16
Showing 13 changed files
... ...
@@ -31,8 +31,8 @@ func newUpdateCommand(dockerCli command.Cli) *cobra.Command {
31 31
 	}
32 32
 
33 33
 	flags := cmd.Flags()
34
-	flags.StringVar(&nodeOpts.role, flagRole, "", "Role of the node (worker/manager)")
35
-	flags.StringVar(&nodeOpts.availability, flagAvailability, "", "Availability of the node (active/pause/drain)")
34
+	flags.StringVar(&nodeOpts.role, flagRole, "", `Role of the node ("worker"|"manager")`)
35
+	flags.StringVar(&nodeOpts.availability, flagAvailability, "", `Availability of the node ("active"|"pause"|"drain")`)
36 36
 	flags.Var(&nodeOpts.annotations.labels, flagLabelAdd, "Add or update a node label (key=value)")
37 37
 	labelKeys := opts.NewListOpts(nil)
38 38
 	flags.Var(&labelKeys, flagLabelRemove, "Remove a node label if exists")
... ...
@@ -446,7 +446,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
446 446
 
447 447
 	flags.Var(&opts.replicas, flagReplicas, "Number of tasks")
448 448
 
449
-	flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", "Restart when condition is met (none, on-failure, or any)")
449
+	flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", `Restart when condition is met ("none"|"on-failure"|"any")`)
450 450
 	flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts (ns|us|ms|s|m|h)")
451 451
 	flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
452 452
 	flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy (ns|us|ms|s|m|h)")
... ...
@@ -455,7 +455,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
455 455
 	flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates (ns|us|ms|s|m|h) (default 0s)")
456 456
 	flags.DurationVar(&opts.update.monitor, flagUpdateMonitor, time.Duration(0), "Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)")
457 457
 	flags.SetAnnotation(flagUpdateMonitor, "version", []string{"1.25"})
458
-	flags.StringVar(&opts.update.onFailure, flagUpdateFailureAction, "pause", "Action on update failure (pause|continue)")
458
+	flags.StringVar(&opts.update.onFailure, flagUpdateFailureAction, "pause", `Action on update failure ("pause"|"continue")`)
459 459
 	flags.Var(&opts.update.maxFailureRatio, flagUpdateMaxFailureRatio, "Failure rate to tolerate during an update")
460 460
 	flags.SetAnnotation(flagUpdateMaxFailureRatio, "version", []string{"1.25"})
461 461
 
... ...
@@ -42,7 +42,7 @@ func newInitCommand(dockerCli command.Cli) *cobra.Command {
42 42
 	flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
43 43
 	flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state")
44 44
 	flags.BoolVar(&opts.autolock, flagAutolock, false, "Enable manager autolocking (requiring an unlock key to start a stopped manager)")
45
-	flags.StringVar(&opts.availability, flagAvailability, "active", "Availability of the node (active/pause/drain)")
45
+	flags.StringVar(&opts.availability, flagAvailability, "active", `Availability of the node ("active"|"pause"|"drain")`)
46 46
 	addSwarmFlags(flags, &opts.swarmOptions)
47 47
 	return cmd
48 48
 }
... ...
@@ -41,7 +41,7 @@ func newJoinCommand(dockerCli command.Cli) *cobra.Command {
41 41
 	flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: <ip|interface>[:port])")
42 42
 	flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
43 43
 	flags.StringVar(&opts.token, flagToken, "", "Token for entry into the swarm")
44
-	flags.StringVar(&opts.availability, flagAvailability, "active", "Availability of the node (active/pause/drain)")
44
+	flags.StringVar(&opts.availability, flagAvailability, "active", `Availability of the node ("active"|"pause"|"drain")`)
45 45
 	return cmd
46 46
 }
47 47
 
... ...
@@ -53,7 +53,7 @@ func (commonOpts *CommonOptions) InstallFlags(flags *pflag.FlagSet) {
53 53
 	}
54 54
 
55 55
 	flags.BoolVarP(&commonOpts.Debug, "debug", "D", false, "Enable debug mode")
56
-	flags.StringVarP(&commonOpts.LogLevel, "log-level", "l", "info", "Set the logging level (\"debug\", \"info\", \"warn\", \"error\", \"fatal\")")
56
+	flags.StringVarP(&commonOpts.LogLevel, "log-level", "l", "info", `Set the logging level ("debug"|"info"|"warn"|"error"|"fatal")`)
57 57
 	flags.BoolVar(&commonOpts.TLS, "tls", false, "Use TLS; implied by --tlsverify")
58 58
 	flags.BoolVar(&commonOpts.TLSVerify, FlagTLSVerify, dockerTLSVerify, "Use TLS and verify the remote")
59 59
 
... ...
@@ -4144,8 +4144,8 @@ JSON Parameters:
4144 4144
     - **Name** – User-defined name for the node.
4145 4145
     - **Labels** – A map of labels to associate with the node (e.g.,
4146 4146
       `{"key":"value", "key2":"value2"}`).
4147
-- **Role** - Role of the node (worker/manager).
4148
-- **Availability** - Availability of the node (active/pause/drain).
4147
+- **Role** - Role of the node (worker|manager).
4148
+- **Availability** - Availability of the node (active|pause|drain).
4149 4149
 
4150 4150
 
4151 4151
 **Status codes**:
... ...
@@ -30,7 +30,7 @@ Options:
30 30
   -D, --debug              Enable debug mode
31 31
       --help               Print usage
32 32
   -H, --host value         Daemon socket(s) to connect to (default [])
33
-  -l, --log-level string   Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info")
33
+  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
34 34
       --tls                Use TLS; implied by --tlsverify
35 35
       --tlscacert string   Trust certs signed only by this CA (default "/root/.docker/ca.pem")
36 36
       --tlscert string     Path to TLS certificate file (default "/root/.docker/cert.pem")
... ...
@@ -64,7 +64,7 @@ Options:
64 64
       --label value                           Set key=value labels to the daemon (default [])
65 65
       --live-restore                          Enable live restore of docker when containers are still running (Linux only)
66 66
       --log-driver string                     Default driver for container logs (default "json-file")
67
-  -l, --log-level string                      Set the logging level ("debug", "info", "warn", "error", "fatal") (default "info")
67
+  -l, --log-level string                      Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
68 68
       --log-opt value                         Default log driver options for containers (default map[])
69 69
       --max-concurrent-downloads int          Set the max concurrent downloads for each pull (default 3)
70 70
       --max-concurrent-uploads int            Set the max concurrent uploads for each push (default 5)
... ...
@@ -21,11 +21,11 @@ Usage:  docker node update [OPTIONS] NODE
21 21
 Update a node
22 22
 
23 23
 Options:
24
-      --availability string   Availability of the node (active/pause/drain)
24
+      --availability string   Availability of the node ("active"|"pause"|"drain")
25 25
       --help                  Print usage
26 26
       --label-add value       Add or update a node label (key=value) (default [])
27 27
       --label-rm value        Remove a node label if exists (default [])
28
-      --role string           Role of the node (worker/manager)
28
+      --role string           Role of the node ("worker"|"manager")
29 29
 ```
30 30
 
31 31
 ### Add label metadata to a node
... ...
@@ -26,7 +26,7 @@ Options:
26 26
       --dns list                         Set custom DNS servers (default [])
27 27
       --dns-option list                  Set DNS options (default [])
28 28
       --dns-search list                  Set custom DNS search domains (default [])
29
-      --endpoint-mode string             Endpoint mode (vip or dnsrr) (default "vip")
29
+      --endpoint-mode string             Endpoint mode ("vip"|"dnsrr") (default "vip")
30 30
   -e, --env list                         Set environment variables (default [])
31 31
       --env-file list                    Read in a file of environment variables (default [])
32 32
       --group list                       Set one or more supplementary user groups for the container (default [])
... ...
@@ -52,7 +52,7 @@ Options:
52 52
       --replicas uint                    Number of tasks
53 53
       --reserve-cpu decimal              Reserve CPUs (default 0.000)
54 54
       --reserve-memory bytes             Reserve Memory
55
-      --restart-condition string         Restart when condition is met (none, on-failure, or any)
55
+      --restart-condition string         Restart when condition is met ("none"|"on-failure"|"any")
56 56
       --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
57 57
       --restart-max-attempts uint        Maximum number of restarts before giving up
58 58
       --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
... ...
@@ -60,7 +60,7 @@ Options:
60 60
       --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
61 61
   -t, --tty                              Allocate a pseudo-TTY
62 62
       --update-delay duration            Delay between updates (ns|us|ms|s|m|h) (default 0s)
63
-      --update-failure-action string     Action on update failure (pause|continue) (default "pause")
63
+      --update-failure-action string     Action on update failure ("pause"|"continue") (default "pause")
64 64
       --update-max-failure-ratio float   Failure rate to tolerate during an update
65 65
       --update-monitor duration          Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)
66 66
       --update-parallelism uint          Maximum number of tasks updated simultaneously (0 to update all at once) (default 1)
... ...
@@ -32,7 +32,7 @@ Options:
32 32
       --dns-rm list                      Remove a custom DNS server (default [])
33 33
       --dns-search-add list              Add or update a custom DNS search domain (default [])
34 34
       --dns-search-rm list               Remove a DNS search domain (default [])
35
-      --endpoint-mode string             Endpoint mode (vip or dnsrr) (default "vip")
35
+      --endpoint-mode string             Endpoint mode ("vip"|"dnsrr") (default "vip")
36 36
       --env-add list                     Add or update an environment variable (default [])
37 37
       --env-rm list                      Remove an environment variable (default [])
38 38
       --force                            Force update even if no changes require it
... ...
@@ -62,7 +62,7 @@ Options:
62 62
       --replicas uint                    Number of tasks
63 63
       --reserve-cpu decimal              Reserve CPUs (default 0.000)
64 64
       --reserve-memory bytes             Reserve Memory
65
-      --restart-condition string         Restart when condition is met (none, on-failure, or any)
65
+      --restart-condition string         Restart when condition is met ("none"|"on-failure"|"any")
66 66
       --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
67 67
       --restart-max-attempts uint        Maximum number of restarts before giving up
68 68
       --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
... ...
@@ -72,7 +72,7 @@ Options:
72 72
       --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
73 73
   -t, --tty                              Allocate a pseudo-TTY
74 74
       --update-delay duration            Delay between updates (ns|us|ms|s|m|h) (default 0s)
75
-      --update-failure-action string     Action on update failure (pause|continue) (default "pause")
75
+      --update-failure-action string     Action on update failure ("pause"|"continue") (default "pause")
76 76
       --update-max-failure-ratio float   Failure rate to tolerate during an update
77 77
       --update-monitor duration          Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)
78 78
       --update-parallelism uint          Maximum number of tasks updated simultaneously (0 to update all at once) (default 1)
... ...
@@ -23,7 +23,7 @@ Initialize a swarm
23 23
 Options:
24 24
       --advertise-addr string           Advertised address (format: <ip|interface>[:port])
25 25
       --autolock                        Enable manager autolocking (requiring an unlock key to start a stopped manager)
26
-      --availability string             Availability of the node (active/pause/drain) (default "active")
26
+      --availability string             Availability of the node ("active"|"pause"|"drain") (default "active")
27 27
       --cert-expiry duration            Validity period for node certificates (ns|us|ms|s|m|h) (default 2160h0m0s)
28 28
       --dispatcher-heartbeat duration   Dispatcher heartbeat period (ns|us|ms|s|m|h) (default 5s)
29 29
       --external-ca external-ca         Specifications of one or more certificate signing endpoints
... ...
@@ -22,7 +22,7 @@ Join a swarm as a node and/or manager
22 22
 
23 23
 Options:
24 24
       --advertise-addr string   Advertised address (format: <ip|interface>[:port])
25
-      --availability string     Availability of the node (active/pause/drain) (default "active")
25
+      --availability string     Availability of the node ("active"|"pause"|"drain") (default "active")
26 26
       --help                    Print usage
27 27
       --listen-addr node-addr   Listen address (format: <ip|interface>[:port]) (default 0.0.0.0:2377)
28 28
       --token string            Token for entry into the swarm