1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #29918 from dongluochen/service_inspect_pretty

add port PublishMode to service inspect --pretty output
This commit is contained in:
Vincent Demeester 2017-01-09 22:43:41 +01:00 committed by GitHub
commit d6c8391bf6
3 changed files with 8 additions and 8 deletions

View file

@ -103,6 +103,7 @@ Ports:
PublishedPort {{ $port.PublishedPort }}
Protocol = {{ $port.Protocol }}
TargetPort = {{ $port.TargetPort }}
PublishMode = {{ $port.PublishMode }}
{{- end }} {{ end -}}
`

View file

@ -692,11 +692,7 @@ portLoop:
ports := flags.Lookup(flagPublishAdd).Value.(*opts.PortOpt).Value()
for _, port := range ports {
if v, ok := portSet[portConfigToString(&port)]; ok {
if v != port {
fmt.Println("v", v)
return fmt.Errorf("conflicting port mapping between %v:%v/%s and %v:%v/%s", port.PublishedPort, port.TargetPort, port.Protocol, v.PublishedPort, v.TargetPort, v.Protocol)
}
if _, ok := portSet[portConfigToString(&port)]; ok {
continue
}
//portSet[portConfigToString(&port)] = port

View file

@ -125,15 +125,18 @@ Service Mode: REPLICATED
Placement:
UpdateConfig:
Parallelism: 0
On failure: pause
Max failure ratio: 0
ContainerSpec:
Image: nginx:alpine
Resources:
Networks: net1
Endpoint Mode: vip
Ports:
Name =
Protocol = tcp
TargetPort = 443
PublishedPort = 4443
Protocol = tcp
TargetPort = 443
PublishMode = ingress
```
You can also use `--format pretty` for the same effect.