Merge pull request #19429 from mavenugo/epv21

nil ptr check for endpointsettings when used with older clients
This commit is contained in:
Antonio Murdaca 2016-01-19 08:43:04 +01:00
Родитель 42ee908b3f 35dbce109b
Коммит 6a1100cafc
1 изменённых файлов: 11 добавлений и 12 удалений

Просмотреть файл

@ -757,21 +757,20 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
return nil
}
if !containertypes.NetworkMode(idOrName).IsUserDefined() && hasUserDefinedIPAddress(endpointConfig) {
return runconfig.ErrUnsupportedNetworkAndIP
}
if !containertypes.NetworkMode(idOrName).IsUserDefined() && len(endpointConfig.Aliases) > 0 {
return runconfig.ErrUnsupportedNetworkAndAlias
}
controller := daemon.netController
if err := validateNetworkingConfig(n, endpointConfig); err != nil {
return err
}
if endpointConfig != nil {
if !containertypes.NetworkMode(idOrName).IsUserDefined() && hasUserDefinedIPAddress(endpointConfig) {
return runconfig.ErrUnsupportedNetworkAndIP
}
if err := validateNetworkingConfig(n, endpointConfig); err != nil {
return err
}
if !containertypes.NetworkMode(idOrName).IsUserDefined() && len(endpointConfig.Aliases) > 0 {
return runconfig.ErrUnsupportedNetworkAndAlias
}
container.NetworkSettings.Networks[n.Name()] = endpointConfig
}