Skip to content

Commit 6735220

Browse files
committed
ignore missing (swarm) overlay networks
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent d7d29b2 commit 6735220

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/compose/create.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,14 @@ func (s *composeService) ensureNetwork(ctx context.Context, n types.NetworkConfi
10141014
if err != nil {
10151015
if errdefs.IsNotFound(err) {
10161016
if n.External.External {
1017+
if n.Driver == "overlay" {
1018+
// Swarm nodes do not register overlay networks that were
1019+
// created on a different node unless they're in use.
1020+
// Here we assume `driver` is relevant for a network we don't manage
1021+
// which is a non-sense, but this is our legacy ¯\(ツ)/¯
1022+
// networkAttach will later fail anyway if network actually doesn't exists
1023+
return nil
1024+
}
10171025
return fmt.Errorf("network %s declared as external, but could not be found", n.Name)
10181026
}
10191027
var ipam *network.IPAM

0 commit comments

Comments
 (0)