mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
add port PublishMode to service inspect --pretty output
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
This commit is contained in:
parent
3e298f46a2
commit
5470312d23
3 changed files with 8 additions and 8 deletions
|
@ -103,6 +103,7 @@ Ports:
|
|||
PublishedPort {{ $port.PublishedPort }}
|
||||
Protocol = {{ $port.Protocol }}
|
||||
TargetPort = {{ $port.TargetPort }}
|
||||
PublishMode = {{ $port.PublishMode }}
|
||||
{{- end }} {{ end -}}
|
||||
`
|
||||
|
||||
|
|
|
@ -691,11 +691,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
|
||||
|
|
|
@ -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 =
|
||||
PublishedPort = 4443
|
||||
Protocol = tcp
|
||||
TargetPort = 443
|
||||
PublishedPort = 4443
|
||||
PublishMode = ingress
|
||||
```
|
||||
|
||||
You can also use `--format pretty` for the same effect.
|
||||
|
|
Loading…
Reference in a new issue