From 6ad95c4dad4aa58d4288b43b58044de0d439d3ad Mon Sep 17 00:00:00 2001 From: Alicia Lauerman Date: Thu, 3 Nov 2016 14:20:53 -0400 Subject: [PATCH] remove COMMAND column from service ls output. closes #27994 Signed-off-by: Alicia Lauerman --- cli/command/service/list.go | 8 +++----- docs/reference/commandline/service_create.md | 6 +++--- docs/reference/commandline/service_inspect.md | 2 +- docs/reference/commandline/service_ls.md | 10 +++++----- docs/reference/commandline/service_rm.md | 2 +- docs/reference/commandline/service_scale.md | 8 ++++---- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/cli/command/service/list.go b/cli/command/service/list.go index 4db5618798..05b425a45e 100644 --- a/cli/command/service/list.go +++ b/cli/command/service/list.go @@ -3,7 +3,6 @@ package service import ( "fmt" "io" - "strings" "text/tabwriter" "github.com/docker/docker/api/types" @@ -18,7 +17,7 @@ import ( ) const ( - listItemFmt = "%s\t%s\t%s\t%s\t%s\n" + listItemFmt = "%s\t%s\t%s\t%s\n" ) type listOptions struct { @@ -110,7 +109,7 @@ func printTable(out io.Writer, services []swarm.Service, running map[string]int) // Ignore flushing errors defer writer.Flush() - fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE", "COMMAND") + fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE") for _, service := range services { replicas := "" if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil { @@ -124,8 +123,7 @@ func printTable(out io.Writer, services []swarm.Service, running map[string]int) stringid.TruncateID(service.ID), service.Spec.Name, replicas, - service.Spec.TaskTemplate.ContainerSpec.Image, - strings.Join(service.Spec.TaskTemplate.ContainerSpec.Args, " ")) + service.Spec.TaskTemplate.ContainerSpec.Image) } } diff --git a/docs/reference/commandline/service_create.md b/docs/reference/commandline/service_create.md index b16f4c654f..4069e0d31c 100644 --- a/docs/reference/commandline/service_create.md +++ b/docs/reference/commandline/service_create.md @@ -73,7 +73,7 @@ $ docker service create --name redis redis:3.0.6 dmu1ept4cxcfe8k8lhtux3ro3 $ docker service ls -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE dmu1ept4cxcf redis 1/1 redis:3.0.6 ``` @@ -97,7 +97,7 @@ number of `RUNNING` tasks is `3`: ```bash $ docker service ls -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 4cdgfyky7ozw redis 3/5 redis:3.0.7 ``` @@ -106,7 +106,7 @@ equal to the desired number: ```bash $ docker service ls -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 4cdgfyky7ozw redis 5/5 redis:3.0.7 ``` diff --git a/docs/reference/commandline/service_inspect.md b/docs/reference/commandline/service_inspect.md index 0407e19047..aba25ac79d 100644 --- a/docs/reference/commandline/service_inspect.md +++ b/docs/reference/commandline/service_inspect.md @@ -46,7 +46,7 @@ For example, given the following service; ```bash $ docker service ls -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE dmu1ept4cxcf redis 3/3 redis:3.0.6 ``` diff --git a/docs/reference/commandline/service_ls.md b/docs/reference/commandline/service_ls.md index 909334dc3a..ed7dd5383b 100644 --- a/docs/reference/commandline/service_ls.md +++ b/docs/reference/commandline/service_ls.md @@ -34,7 +34,7 @@ swarm. On a manager node: ```bash -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE c8wgl7q4ndfd frontend 5/5 nginx:alpine dmu1ept4cxcf redis 3/3 redis:3.0.6 ``` @@ -60,7 +60,7 @@ The `id` filter matches all or part of a service's id. ```bash $ docker service ls -f "id=0bcjw" -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 0bcjwfh8ychr redis 1/1 redis:3.0.6 ``` @@ -74,7 +74,7 @@ its value: ```bash $ docker service ls --filter label=project -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 01sl1rp6nj5u frontend2 1/1 nginx:alpine 36xvvwwauej0 frontend 5/5 nginx:alpine 74nzcxxjv6fq backend 3/3 redis:3.0.6 @@ -85,7 +85,7 @@ The following filter matches only services with the `project` label with the ```bash $ docker service ls --filter label=project=project-a -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 36xvvwwauej0 frontend 5/5 nginx:alpine 74nzcxxjv6fq backend 3/3 redis:3.0.6 ``` @@ -99,7 +99,7 @@ The following filter matches services with a name containing `redis`. ```bash $ docker service ls --filter name=redis -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 0bcjwfh8ychr redis 1/1 redis:3.0.6 ``` diff --git a/docs/reference/commandline/service_rm.md b/docs/reference/commandline/service_rm.md index 43db9af7e6..373c98b030 100644 --- a/docs/reference/commandline/service_rm.md +++ b/docs/reference/commandline/service_rm.md @@ -36,7 +36,7 @@ For example, to remove the redis service: $ docker service rm redis redis $ docker service ls -ID NAME SCALE IMAGE COMMAND +ID NAME SCALE IMAGE ``` > **Warning**: Unlike `docker rm`, this command does not ask for confirmation diff --git a/docs/reference/commandline/service_scale.md b/docs/reference/commandline/service_scale.md index 68dfa68c91..1c1f289709 100644 --- a/docs/reference/commandline/service_scale.md +++ b/docs/reference/commandline/service_scale.md @@ -28,8 +28,8 @@ Options: ### Scale a service -The scale command enables you to scale one or more replicated services either up -or down to the desired number of replicas. This command cannot be applied on +The scale command enables you to scale one or more replicated services either up +or down to the desired number of replicas. This command cannot be applied on services which are global mode. The command will return immediately, but the actual scaling of the service may take some time. To stop all replicas of a service while keeping the service active in the swarm you can set the scale to 0. @@ -56,7 +56,7 @@ replicas. ```bash $ docker service ls --filter name=frontend -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 3pr5mlvu3fh9 frontend 15/50 nginx:alpine ``` @@ -80,7 +80,7 @@ backend scaled to 3 frontend scaled to 5 $ docker service ls -ID NAME REPLICAS IMAGE COMMAND +ID NAME REPLICAS IMAGE 3pr5mlvu3fh9 frontend 5/5 nginx:alpine 74nzcxxjv6fq backend 3/3 redis:3.0.6 ```