Skip to content

Commit d735972

Browse files
author
yupengzte
committed
fix the type
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
1 parent 14790e4 commit d735972

File tree

13 files changed

+21
-21
lines changed

13 files changed

+21
-21
lines changed

cli/command/node/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func newUpdateCommand(dockerCli command.Cli) *cobra.Command {
3131
}
3232

3333
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")`)
3636
flags.Var(&nodeOpts.annotations.labels, flagLabelAdd, "Add or update a node label (key=value)")
3737
labelKeys := opts.NewListOpts(nil)
3838
flags.Var(&labelKeys, flagLabelRemove, "Remove a node label if exists")

cli/command/service/opts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
446446

447447
flags.Var(&opts.replicas, flagReplicas, "Number of tasks")
448448

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")`)
450450
flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts (ns|us|ms|s|m|h)")
451451
flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
452452
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) {
455455
flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates (ns|us|ms|s|m|h) (default 0s)")
456456
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)")
457457
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")`)
459459
flags.Var(&opts.update.maxFailureRatio, flagUpdateMaxFailureRatio, "Failure rate to tolerate during an update")
460460
flags.SetAnnotation(flagUpdateMaxFailureRatio, "version", []string{"1.25"})
461461

cli/command/swarm/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func newInitCommand(dockerCli command.Cli) *cobra.Command {
4242
flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
4343
flags.BoolVar(&opts.forceNewCluster, "force-new-cluster", false, "Force create a new cluster from current state")
4444
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")`)
4646
addSwarmFlags(flags, &opts.swarmOptions)
4747
return cmd
4848
}

cli/command/swarm/join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func newJoinCommand(dockerCli command.Cli) *cobra.Command {
4141
flags.Var(&opts.listenAddr, flagListenAddr, "Listen address (format: <ip|interface>[:port])")
4242
flags.StringVar(&opts.advertiseAddr, flagAdvertiseAddr, "", "Advertised address (format: <ip|interface>[:port])")
4343
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")`)
4545
return cmd
4646
}
4747

cli/flags/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (commonOpts *CommonOptions) InstallFlags(flags *pflag.FlagSet) {
5353
}
5454

5555
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")`)
5757
flags.BoolVar(&commonOpts.TLS, "tls", false, "Use TLS; implied by --tlsverify")
5858
flags.BoolVar(&commonOpts.TLSVerify, FlagTLSVerify, dockerTLSVerify, "Use TLS and verify the remote")
5959

docs/api/v1.24.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4144,8 +4144,8 @@ JSON Parameters:
41444144
- **Name** – User-defined name for the node.
41454145
- **Labels** – A map of labels to associate with the node (e.g.,
41464146
`{"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).
41494149
41504150
41514151
**Status codes**:

docs/reference/commandline/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Options:
3030
-D, --debug Enable debug mode
3131
--help Print usage
3232
-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")
3434
--tls Use TLS; implied by --tlsverify
3535
--tlscacert string Trust certs signed only by this CA (default "/root/.docker/ca.pem")
3636
--tlscert string Path to TLS certificate file (default "/root/.docker/cert.pem")

docs/reference/commandline/dockerd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Options:
6464
--label value Set key=value labels to the daemon (default [])
6565
--live-restore Enable live restore of docker when containers are still running (Linux only)
6666
--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")
6868
--log-opt value Default log driver options for containers (default map[])
6969
--max-concurrent-downloads int Set the max concurrent downloads for each pull (default 3)
7070
--max-concurrent-uploads int Set the max concurrent uploads for each push (default 5)

docs/reference/commandline/node_update.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Usage: docker node update [OPTIONS] NODE
2121
Update a node
2222

2323
Options:
24-
--availability string Availability of the node (active/pause/drain)
24+
--availability string Availability of the node ("active"|"pause"|"drain")
2525
--help Print usage
2626
--label-add value Add or update a node label (key=value) (default [])
2727
--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")
2929
```
3030

3131
### Add label metadata to a node

docs/reference/commandline/service_create.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Options:
2626
--dns list Set custom DNS servers (default [])
2727
--dns-option list Set DNS options (default [])
2828
--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")
3030
-e, --env list Set environment variables (default [])
3131
--env-file list Read in a file of environment variables (default [])
3232
--group list Set one or more supplementary user groups for the container (default [])
@@ -52,15 +52,15 @@ Options:
5252
--replicas uint Number of tasks
5353
--reserve-cpu decimal Reserve CPUs (default 0.000)
5454
--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")
5656
--restart-delay duration Delay between restart attempts (ns|us|ms|s|m|h)
5757
--restart-max-attempts uint Maximum number of restarts before giving up
5858
--restart-window duration Window used to evaluate the restart policy (ns|us|ms|s|m|h)
5959
--secret secret Specify secrets to expose to the service
6060
--stop-grace-period duration Time to wait before force killing a container (ns|us|ms|s|m|h)
6161
-t, --tty Allocate a pseudo-TTY
6262
--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")
6464
--update-max-failure-ratio float Failure rate to tolerate during an update
6565
--update-monitor duration Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)
6666
--update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1)

0 commit comments

Comments
 (0)