mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Add insecure registries to docker info
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user