1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Vendoring libnetwork @802895f

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2017-02-02 15:22:26 -08:00
parent e07c392c49
commit 9e555ce7c3
17 changed files with 159 additions and 141 deletions

View file

@ -567,6 +567,12 @@ func (c *controller) pushNodeDiscovery(d driverapi.Driver, cap driverapi.Capabil
if c.cfg != nil {
addr := strings.Split(c.cfg.Cluster.Address, ":")
self = net.ParseIP(addr[0])
// if external kvstore is not configured, try swarm-mode config
if self == nil {
if agent := c.getAgent(); agent != nil {
self = net.ParseIP(agent.advertiseAddr)
}
}
}
if d == nil || cap.DataScope != datastore.GlobalScope || nodes == nil {
@ -647,8 +653,8 @@ func (c *controller) NewNetwork(networkType, name string, id string, options ...
}
}
if err := config.ValidateName(name); err != nil {
return nil, ErrInvalidName(err.Error())
if !config.IsValidName(name) {
return nil, ErrInvalidName(name)
}
if id == "" {