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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user