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:
commit
fb7e9a908b
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue