mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #28804 from bfirsh/better-service-network-overlay-error-message
Improve error when connecting service to network
This commit is contained in:
commit
8602d97835
1 changed files with 1 additions and 1 deletions
|
@ -1764,7 +1764,7 @@ func (c *Cluster) populateNetworkID(ctx context.Context, client swarmapi.Control
|
||||||
apiNetwork, err := getNetwork(ctx, client, n.Target)
|
apiNetwork, err := getNetwork(ctx, client, n.Target)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if ln, _ := c.config.Backend.FindNetwork(n.Target); ln != nil && !ln.Info().Dynamic() {
|
if ln, _ := c.config.Backend.FindNetwork(n.Target); ln != nil && !ln.Info().Dynamic() {
|
||||||
err = fmt.Errorf("network %s is not eligible for docker services", ln.Name())
|
err = fmt.Errorf("The network %s cannot be used with services. Only networks scoped to the swarm can be used, such as those created with the overlay driver.", ln.Name())
|
||||||
return apierrors.NewRequestForbiddenError(err)
|
return apierrors.NewRequestForbiddenError(err)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue