Merge pull request #28663 from vdemeester/28633-do-not-panic-on-empty-network

Do not panic if network is nil
Upstream-commit: fb7e9a908b117afb1b3e173cebef4679a6407172
Component: engine
This commit is contained in:
Victor Vieux
2016-11-21 10:48:03 -08:00
committed by GitHub
@@ -252,9 +252,13 @@ func convertServiceNetworks(
nets := []swarm.NetworkAttachmentConfig{}
for networkName, network := range networks {
var aliases []string
if network != nil {
aliases = network.Aliases
}
nets = append(nets, swarm.NetworkAttachmentConfig{
Target: namespace.scope(networkName),
Aliases: append(network.Aliases, name),
Aliases: append(aliases, name),
})
}
return nets