Merge pull request #17274 from aboch/ai

Turn off discovery when icc == false
Upstream-commit: 2afdc6582b203c2beaeaca6ff14f61ae50f8cab9
Component: engine
This commit is contained in:
David Calavera
2015-10-22 13:08:31 -07:00
5 changed files with 109 additions and 3 deletions
+6 -2
View File
@@ -783,7 +783,7 @@ func (container *Container) updateNetwork() error {
return nil
}
func (container *Container) buildCreateEndpointOptions() ([]libnetwork.EndpointOption, error) {
func (container *Container) buildCreateEndpointOptions(n libnetwork.Network) ([]libnetwork.EndpointOption, error) {
var (
portSpecs = make(nat.PortSet)
bindings = make(nat.PortMap)
@@ -861,6 +861,10 @@ func (container *Container) buildCreateEndpointOptions() ([]libnetwork.EndpointO
createOptions = append(createOptions, libnetwork.EndpointOptionGeneric(genericOption))
}
if n.Name() == "bridge" && !container.daemon.config().Bridge.InterContainerCommunication {
createOptions = append(createOptions, libnetwork.CreateOptionAnonymous())
}
return createOptions, nil
}
@@ -950,7 +954,7 @@ func (container *Container) connectToNetwork(idOrName string, updateSettings boo
return err
}
createOptions, err := container.buildCreateEndpointOptions()
createOptions, err := container.buildCreateEndpointOptions(n)
if err != nil {
return err
}