1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add insecure registries to docker info

Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
This commit is contained in:
Tomasz Kopczynski 2016-02-16 23:45:48 +01:00
parent d78f8f2796
commit 44a50abe7b
4 changed files with 38 additions and 0 deletions

View file

@ -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))
}