add error message

Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2015-04-03 01:28:08 +00:00
parent de66ff37d5
commit c41d73dd50
1 changed files with 5 additions and 0 deletions

View File

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