Skip to content

Commit

Permalink
Add comment explaining network-create flow for Swarm
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Murray <[email protected]>
  • Loading branch information
robmry committed Feb 9, 2024
1 parent 571af91 commit a26c953
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/server/router/network/network_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ func (n *networkRouter) postNetworkCreate(ctx context.Context, w http.ResponseWr
return libnetwork.NetworkNameError(create.Name)
}

// For a Swarm-scoped network, this call to backend.CreateNetwork is used to
// validate the configuration. The network will not be created but, if the
// configuration is valid, ManagerRedirectError will be returned and handled
// below.
nw, err := n.backend.CreateNetwork(create)
if err != nil {
if _, ok := err.(libnetwork.ManagerRedirectError); !ok {
Expand Down

0 comments on commit a26c953

Please sign in to comment.