فهرست منبع

service ls: Show tasks from nodes that are not down, not only "ready" nodes

Currently, the counter only shows tasks on READY nodes. It's more
correct to also count nodes in the other states except DOWN, because
the tasks assocated with those nodes are still assumed to be running for
orchestration purposes. One example of when this could matter is during
a leader failover when agents are in the process of reconnecting.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Aaron Lehmann 9 سال پیش
والد
کامیت
614ad95fbb
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      api/client/service/list.go

+ 1 - 1
api/client/service/list.go

@@ -84,7 +84,7 @@ func runList(dockerCli *client.DockerCli, opts listOptions) error {
 func PrintNotQuiet(out io.Writer, services []swarm.Service, nodes []swarm.Node, tasks []swarm.Task) {
 	activeNodes := make(map[string]struct{})
 	for _, n := range nodes {
-		if n.Status.State == swarm.NodeStateReady {
+		if n.Status.State != swarm.NodeStateDown {
 			activeNodes[n.ID] = struct{}{}
 		}
 	}