|
@@ -213,6 +213,10 @@ func (n *networkRouter) postNetworkCreate(ctx context.Context, w http.ResponseWr
|
|
return libnetwork.NetworkNameError(create.Name)
|
|
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)
|
|
nw, err := n.backend.CreateNetwork(create)
|
|
if err != nil {
|
|
if err != nil {
|
|
if _, ok := err.(libnetwork.ManagerRedirectError); !ok {
|
|
if _, ok := err.(libnetwork.ManagerRedirectError); !ok {
|