mirror of https://github.com/docker/docs.git
Merge pull request #218 from chanwit/check-dup-id
Proposal: report error when two Docker's IDs are duplicated
This commit is contained in:
commit
9c5896f65c
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue