Add insecure registries to docker info

Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
Upstream-commit: 44a50abe7b16368bdc8b70e01cb095dc46cbbbaf
Component: engine
This commit is contained in:
Tomasz Kopczynski
2016-03-31 08:27:24 +02:00
parent 693174fcad
commit 58855775ca
4 changed files with 38 additions and 0 deletions
@@ -164,3 +164,21 @@ func (s *DockerSuite) TestInfoDebug(c *check.C) {
c.Assert(out, checker.Contains, "EventsListeners")
c.Assert(out, checker.Contains, "Docker Root Dir")
}
func (s *DockerSuite) TestInsecureRegistries(c *check.C) {
testRequires(c, SameHostDaemon, DaemonIsLinux)
registryCIDR := "192.168.1.0/24"
registryHost := "insecurehost.com:5000"
d := NewDaemon(c)
err := d.Start("--insecure-registry="+registryCIDR, "--insecure-registry="+registryHost)
c.Assert(err, checker.IsNil)
defer d.Stop()
out, err := d.Cmd("info")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, "Insecure registries:\n")
c.Assert(out, checker.Contains, fmt.Sprintf(" %s\n", registryHost))
c.Assert(out, checker.Contains, fmt.Sprintf(" %s\n", registryCIDR))
}