improve error of docker network create -d overlay on non-Swarm node
before: Error response from daemon: datastore for scope "global" is not initialized after: Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again. Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp> Upstream-commit: 9c77a4c2973a62beb5e6cc57b1970e97edca97d8 Component: engine
This commit is contained in:
@ -335,6 +335,9 @@ func (daemon *Daemon) createNetwork(create types.NetworkCreateRequest, id string
|
||||
|
||||
n, err := c.NewNetwork(driver, create.Name, id, nwOptions...)
|
||||
if err != nil {
|
||||
if _, ok := err.(libnetwork.ErrDataStoreNotInitialized); ok {
|
||||
return nil, errors.New("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.")
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user