瀏覽代碼

Merge pull request #29450 from yongtang/29291-no-default-replicas-output

Fix misleading defaults for service create/update
Sebastiaan van Stijn 8 年之前
父節點
當前提交
b1cb897998

+ 2 - 2
cli/command/service/opts.go

@@ -84,7 +84,7 @@ func (d *DurationOpt) String() string {
 	if d.value != nil {
 		return d.value.String()
 	}
-	return "none"
+	return ""
 }
 
 // Value returns the time.Duration
@@ -114,7 +114,7 @@ func (i *Uint64Opt) String() string {
 	if i.value != nil {
 		return fmt.Sprintf("%v", *i.value)
 	}
-	return "none"
+	return ""
 }
 
 // Value returns the uint64

+ 1 - 1
cli/command/service/opts_test.go

@@ -59,7 +59,7 @@ func TestUint64OptString(t *testing.T) {
 	assert.Equal(t, opt.String(), "2345678")
 
 	opt = Uint64Opt{}
-	assert.Equal(t, opt.String(), "none")
+	assert.Equal(t, opt.String(), "")
 }
 
 func TestUint64OptSetAndValue(t *testing.T) {

+ 9 - 9
docs/reference/commandline/service_create.md

@@ -31,9 +31,9 @@ Options:
       --env-file list                    Read in a file of environment variables (default [])
       --group list                       Set one or more supplementary user groups for the container (default [])
       --health-cmd string                Command to run to check health
-      --health-interval duration         Time between running the check (ns|us|ms|s|m|h) (default none)
+      --health-interval duration         Time between running the check (ns|us|ms|s|m|h)
       --health-retries int               Consecutive failures needed to report unhealthy
-      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h) (default none)
+      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h)
       --help                             Print usage
       --host list                        Set one or more custom host-to-IP mappings (host:ip) (default [])
       --hostname string                  Container hostname
@@ -47,16 +47,16 @@ Options:
       --name string                      Service name
       --network list                     Network attachments (default [])
       --no-healthcheck                   Disable any container-specified HEALTHCHECK
-  -p, --publish list                     Publish a port as a node port (default [])
-      --replicas uint                    Number of tasks (default none)
+  -p, --publish port                     Publish a port as a node port
+      --replicas uint                    Number of tasks
       --reserve-cpu decimal              Reserve CPUs (default 0.000)
       --reserve-memory bytes             Reserve Memory (default 0 B)
       --restart-condition string         Restart when condition is met (none, on-failure, or any)
-      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h) (default none)
-      --restart-max-attempts uint        Maximum number of restarts before giving up (default none)
-      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h) (default none)
-      --secret value                     Specify secrets to expose to the service (default [])
-      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h) (default none)
+      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
+      --restart-max-attempts uint        Maximum number of restarts before giving up
+      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
+      --secret secret                    Specify secrets to expose to the service
+      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
   -t, --tty                              Allocate a pseudo-TTY
       --update-delay duration            Delay between updates (ns|us|ms|s|m|h) (default 0s)
       --update-failure-action string     Action on update failure (pause|continue) (default "pause")

+ 10 - 10
docs/reference/commandline/service_update.md

@@ -39,9 +39,9 @@ Options:
       --group-add list                   Add an additional supplementary user group to the container (default [])
       --group-rm list                    Remove a previously added supplementary user group from the container (default [])
       --health-cmd string                Command to run to check health
-      --health-interval duration         Time between running the check (ns|us|ms|s|m|h) (default none)
+      --health-interval duration         Time between running the check (ns|us|ms|s|m|h)
       --health-retries int               Consecutive failures needed to report unhealthy
-      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h) (default none)
+      --health-timeout duration          Maximum time to allow one check to run (ns|us|ms|s|m|h)
       --help                             Print usage
       --host-add list                    Add or update a custom host-to-IP mapping (host:ip) (default [])
       --host-rm list                     Remove a custom host-to-IP mapping (host:ip) (default [])
@@ -56,19 +56,19 @@ Options:
       --mount-add mount                  Add or update a mount on a service
       --mount-rm list                    Remove a mount by its target path (default [])
       --no-healthcheck                   Disable any container-specified HEALTHCHECK
-      --publish-add list                 Add or update a published port (default [])
-      --publish-rm list                  Remove a published port by its target port (default [])
-      --replicas uint                    Number of tasks (default none)
+      --publish-add port                 Add or update a published port
+      --publish-rm port                  Remove a published port by its target port
+      --replicas uint                    Number of tasks
       --reserve-cpu decimal              Reserve CPUs (default 0.000)
       --reserve-memory bytes             Reserve Memory (default 0 B)
       --restart-condition string         Restart when condition is met (none, on-failure, or any)
-      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h) (default none)
-      --restart-max-attempts uint        Maximum number of restarts before giving up (default none)
-      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h) (default none)
+      --restart-delay duration           Delay between restart attempts (ns|us|ms|s|m|h)
+      --restart-max-attempts uint        Maximum number of restarts before giving up
+      --restart-window duration          Window used to evaluate the restart policy (ns|us|ms|s|m|h)
       --rollback                         Rollback to previous specification
-      --secret-add list                  Add a secret (default [])
+      --secret-add secret                Add or update a secret on a service
       --secret-rm list                   Remove a secret (default [])
-      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h) (default none)
+      --stop-grace-period duration       Time to wait before force killing a container (ns|us|ms|s|m|h)
   -t, --tty                              Allocate a pseudo-TTY
       --update-delay duration            Delay between updates (ns|us|ms|s|m|h) (default 0s)
       --update-failure-action string     Action on update failure (pause|continue) (default "pause")