From a26c953b94f9ab7bb21810e2b2c98c712323539a Mon Sep 17 00:00:00 2001 From: Rob Murray Date: Fri, 9 Feb 2024 11:06:23 +0000 Subject: [PATCH] Add comment explaining network-create flow for Swarm Signed-off-by: Rob Murray --- api/server/router/network/network_routes.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/server/router/network/network_routes.go b/api/server/router/network/network_routes.go index 0fd67eb310..5520ada530 100644 --- a/api/server/router/network/network_routes.go +++ b/api/server/router/network/network_routes.go @@ -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 {