Skip to content

Commit

Permalink
ignore missing (swarm) overlay networks
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Dec 6, 2021
1 parent d7d29b2 commit 6735220
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,14 @@ func (s *composeService) ensureNetwork(ctx context.Context, n types.NetworkConfi
if err != nil {
if errdefs.IsNotFound(err) {
if n.External.External {
if n.Driver == "overlay" {
// Swarm nodes do not register overlay networks that were
// created on a different node unless they're in use.
// Here we assume `driver` is relevant for a network we don't manage
// which is a non-sense, but this is our legacy ¯\(ツ)/¯
// networkAttach will later fail anyway if network actually doesn't exists
return nil
}
return fmt.Errorf("network %s declared as external, but could not be found", n.Name)
}
var ipam *network.IPAM
Expand Down

0 comments on commit 6735220

Please sign in to comment.