Restore error type in FindNetwork

The error type libnetwork.ErrNoSuchNetwork is used in the controller
to retry the network creation as a managed network though the manager.
The change of the type was breaking the logic causing the network to
not being created anymore so that no new container on that network
was able to be launched
Added unit test

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
(cherry picked from commit 51cea0a53c2fd36832277402e9faac81bfb4abd4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Flavio Crisciani
2017-11-29 16:48:04 -08:00
committed by Sebastiaan van Stijn
parent bb351b1f19
commit c3be82eb0a
5 changed files with 35 additions and 7 deletions
@@ -49,7 +49,7 @@ func (s *DockerSuite) TestNetHostname(c *check.C) {
c.Assert(out, checker.Contains, "Invalid network mode: invalid container format container:<name|id>")
out, _ = dockerCmdWithFail(c, "run", "--net=weird", "busybox", "ps")
c.Assert(strings.ToLower(out), checker.Contains, "no such network")
c.Assert(strings.ToLower(out), checker.Contains, "not found")
}
func (s *DockerSuite) TestConflictContainerNetworkAndLinks(c *check.C) {