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

Do not panic if network is nil
This commit is contained in:
Victor Vieux 2016-11-21 10:48:03 -08:00 committed by GitHub
commit fb7e9a908b

View file

@ -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