From c41d73dd50b1b4de7fc5193b0e57a78d96f9cb02 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 3 Apr 2015 01:28:08 +0000 Subject: [PATCH] add error message Signed-off-by: Victor Vieux --- cluster/swarm/node.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cluster/swarm/node.go b/cluster/swarm/node.go index a4f6710df5..59f34aefc6 100644 --- a/cluster/swarm/node.go +++ b/cluster/swarm/node.go @@ -142,6 +142,11 @@ func (n *node) updateSpecs() error { if err != nil { return err } + + if info.NCPU == 0 || info.MemTotal == 0 { + return fmt.Errorf("cannot get resources for this node, make sure %s is a Docker Engine, not a Swarm manager", n.addr) + } + // Older versions of Docker don't expose the ID field and are not supported // by Swarm. Catch the error ASAP and refuse to connect. if len(info.ID) == 0 {