Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #467 from surajnarwade/fix-network
Browse files Browse the repository at this point in the history
Fixed error causing due to top level network key
  • Loading branch information
Vincent Demeester authored May 15, 2017
2 parents 56b0613 + a478498 commit 01ff892
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ func (p *Project) handleNetworkConfig() {
// Consolidate the name of the network
// FIXME(vdemeester) probably shouldn't be there, maybe move that to interface/factory
for _, network := range serviceConfig.Networks.Networks {
if net, ok := p.NetworkConfigs[network.Name]; ok {
net, ok := p.NetworkConfigs[network.Name]
if ok && net != nil {
if net.External.External {
network.RealName = network.Name
if net.External.Name != "" {
Expand All @@ -297,6 +298,12 @@ func (p *Project) handleNetworkConfig() {
} else {
network.RealName = p.Name + "_" + network.Name
}
} else {
network.RealName = p.Name + "_" + network.Name

p.NetworkConfigs[network.Name] = &config.NetworkConfig{
External: yaml.External{External: false},
}
}
// Ignoring if we don't find the network, it will be catched later
}
Expand Down

0 comments on commit 01ff892

Please sign in to comment.