Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit a478498

Browse files
committed
Fixed error causing due to top level network key
Resolves #456 Signed-off-by: Suraj Narwade <[email protected]>
1 parent 56b0613 commit a478498

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

project/project.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ func (p *Project) handleNetworkConfig() {
288288
// Consolidate the name of the network
289289
// FIXME(vdemeester) probably shouldn't be there, maybe move that to interface/factory
290290
for _, network := range serviceConfig.Networks.Networks {
291-
if net, ok := p.NetworkConfigs[network.Name]; ok {
291+
net, ok := p.NetworkConfigs[network.Name]
292+
if ok && net != nil {
292293
if net.External.External {
293294
network.RealName = network.Name
294295
if net.External.Name != "" {
@@ -297,6 +298,12 @@ func (p *Project) handleNetworkConfig() {
297298
} else {
298299
network.RealName = p.Name + "_" + network.Name
299300
}
301+
} else {
302+
network.RealName = p.Name + "_" + network.Name
303+
304+
p.NetworkConfigs[network.Name] = &config.NetworkConfig{
305+
External: yaml.External{External: false},
306+
}
300307
}
301308
// Ignoring if we don't find the network, it will be catched later
302309
}

0 commit comments

Comments
 (0)