Better error message for network connect
Use better error message when user want to connect container with same name to one network, this can help avoid confusion. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
parent
91657008f2
commit
8edb941b79
1 changed files with 1 additions and 1 deletions
|
@ -616,7 +616,7 @@ func (daemon *Daemon) connectToNetwork(container *container.Container, idOrName
|
|||
|
||||
ep, err := container.GetEndpointInNetwork(n)
|
||||
if err == nil {
|
||||
return fmt.Errorf("container already connected to network %s", idOrName)
|
||||
return fmt.Errorf("Conflict. A container with name %q is already connected to network %s.", strings.TrimPrefix(container.Name, "/"), idOrName)
|
||||
}
|
||||
|
||||
if _, ok := err.(libnetwork.ErrNoSuchEndpoint); !ok {
|
||||
|
|
Loading…
Reference in a new issue