Browse Source

add port PublishMode to service inspect --pretty output

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Dong Chen 8 years ago
parent
commit
5470312d23

+ 1 - 0
cli/command/formatter/service.go

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

+ 1 - 5
cli/command/service/update.go

@@ -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

+ 6 - 3
docs/reference/commandline/service_inspect.md

@@ -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.