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>
This commit is contained in:
parent
3343653edb
commit
9c77a4c297
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue