Improve docker service inspect --pretty

Remove capitalization in placement, and remove spurious `\t`.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie (icecrime) 2016-06-17 11:38:19 -07:00
parent c1dd933c02
commit 3c60b7b984
No known key found for this signature in database
GPG key ID: 3D78FAF1AF91D9E9

View file

@ -94,11 +94,11 @@ func printService(out io.Writer, service swarm.Service) {
}
if service.Spec.Mode.Global != nil {
fmt.Fprintln(out, "Mode:\t\tGLOBAL")
fmt.Fprintln(out, "Mode:\t\tGlobal")
} else {
fmt.Fprintln(out, "Mode:\t\tREPLICATED")
fmt.Fprintln(out, "Mode:\t\tReplicated")
if service.Spec.Mode.Replicated.Replicas != nil {
fmt.Fprintf(out, " Replicas:\t\t%d\n", *service.Spec.Mode.Replicated.Replicas)
fmt.Fprintf(out, " Replicas:\t%d\n", *service.Spec.Mode.Replicated.Replicas)
}
}
fmt.Fprintln(out, "Placement:")
@ -157,7 +157,7 @@ func printContainerSpec(out io.Writer, containerSpec swarm.ContainerSpec) {
fmt.Fprintf(out, " Command:\t%s\n", strings.Join(containerSpec.Command, " "))
}
if len(containerSpec.Args) > 0 {
fmt.Fprintf(out, " Args:\t%s\n", strings.Join(containerSpec.Args, " "))
fmt.Fprintf(out, " Args:\t\t%s\n", strings.Join(containerSpec.Args, " "))
}
if len(containerSpec.Env) > 0 {
fmt.Fprintf(out, " Env:\t\t%s\n", strings.Join(containerSpec.Env, " "))