瀏覽代碼

add port PublishMode to service inspect --pretty output

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Dong Chen 8 年之前
父節點
當前提交
5470312d23
共有 3 個文件被更改,包括 8 次插入8 次删除
  1. 1 0
      cli/command/formatter/service.go
  2. 1 5
      cli/command/service/update.go
  3. 6 3
      docs/reference/commandline/service_inspect.md

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

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

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

@@ -691,11 +691,7 @@ portLoop:
 		ports := flags.Lookup(flagPublishAdd).Value.(*opts.PortOpt).Value()
 		ports := flags.Lookup(flagPublishAdd).Value.(*opts.PortOpt).Value()
 
 
 		for _, port := range ports {
 		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
 				continue
 			}
 			}
 			//portSet[portConfigToString(&port)] = port
 			//portSet[portConfigToString(&port)] = port

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

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