1
0
mirror of https://github.com/docker/docs.git synced 2026-10-31 10:34:26 +03:00

Merge pull request #218 from chanwit/check-dup-id

Proposal: report error when two Docker's IDs are duplicated
This commit is contained in:
Victor Vieux
2015-01-06 17:58:21 -08:00

View File

@@ -48,7 +48,10 @@ func (c *Cluster) AddNode(n *Node) error {
c.Lock()
defer c.Unlock()
if _, exists := c.nodes[n.ID]; exists {
if old, exists := c.nodes[n.ID]; exists {
if old.IP != n.IP {
log.Errorf("ID duplicated. %s shared by %s and %s", n.ID, old.IP, n.IP)
}
return ErrNodeAlreadyRegistered
}