|
@@ -24,8 +24,8 @@ import (
|
|
"github.com/docker/docker/pkg/stringutils"
|
|
"github.com/docker/docker/pkg/stringutils"
|
|
"github.com/docker/docker/runconfig"
|
|
"github.com/docker/docker/runconfig"
|
|
"github.com/docker/go-connections/nat"
|
|
"github.com/docker/go-connections/nat"
|
|
- "github.com/docker/libnetwork/netutils"
|
|
|
|
"github.com/docker/libnetwork/resolvconf"
|
|
"github.com/docker/libnetwork/resolvconf"
|
|
|
|
+ "github.com/docker/libnetwork/types"
|
|
"github.com/go-check/check"
|
|
"github.com/go-check/check"
|
|
libcontainerUser "github.com/opencontainers/runc/libcontainer/user"
|
|
libcontainerUser "github.com/opencontainers/runc/libcontainer/user"
|
|
)
|
|
)
|
|
@@ -1308,13 +1308,13 @@ func (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) {
|
|
c.Fatalf("/etc/resolv.conf does not exist")
|
|
c.Fatalf("/etc/resolv.conf does not exist")
|
|
}
|
|
}
|
|
|
|
|
|
- hostNamservers := resolvconf.GetNameservers(origResolvConf, netutils.IP)
|
|
|
|
|
|
+ hostNamservers := resolvconf.GetNameservers(origResolvConf, types.IP)
|
|
hostSearch := resolvconf.GetSearchDomains(origResolvConf)
|
|
hostSearch := resolvconf.GetSearchDomains(origResolvConf)
|
|
|
|
|
|
var out string
|
|
var out string
|
|
out, _ = dockerCmd(c, "run", "--dns=127.0.0.1", "busybox", "cat", "/etc/resolv.conf")
|
|
out, _ = dockerCmd(c, "run", "--dns=127.0.0.1", "busybox", "cat", "/etc/resolv.conf")
|
|
|
|
|
|
- if actualNameservers := resolvconf.GetNameservers([]byte(out), netutils.IP); string(actualNameservers[0]) != "127.0.0.1" {
|
|
|
|
|
|
+ if actualNameservers := resolvconf.GetNameservers([]byte(out), types.IP); string(actualNameservers[0]) != "127.0.0.1" {
|
|
c.Fatalf("expected '127.0.0.1', but says: %q", string(actualNameservers[0]))
|
|
c.Fatalf("expected '127.0.0.1', but says: %q", string(actualNameservers[0]))
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1330,7 +1330,7 @@ func (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) {
|
|
|
|
|
|
out, _ = dockerCmd(c, "run", "--dns-search=mydomain", "busybox", "cat", "/etc/resolv.conf")
|
|
out, _ = dockerCmd(c, "run", "--dns-search=mydomain", "busybox", "cat", "/etc/resolv.conf")
|
|
|
|
|
|
- actualNameservers := resolvconf.GetNameservers([]byte(out), netutils.IP)
|
|
|
|
|
|
+ actualNameservers := resolvconf.GetNameservers([]byte(out), types.IP)
|
|
if len(actualNameservers) != len(hostNamservers) {
|
|
if len(actualNameservers) != len(hostNamservers) {
|
|
c.Fatalf("expected %q nameserver(s), but it has: %q", len(hostNamservers), len(actualNameservers))
|
|
c.Fatalf("expected %q nameserver(s), but it has: %q", len(hostNamservers), len(actualNameservers))
|
|
}
|
|
}
|
|
@@ -1361,11 +1361,11 @@ func (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) {
|
|
c.Fatalf("/etc/resolv.conf does not exist")
|
|
c.Fatalf("/etc/resolv.conf does not exist")
|
|
}
|
|
}
|
|
|
|
|
|
- hostNamservers = resolvconf.GetNameservers(resolvConf, netutils.IP)
|
|
|
|
|
|
+ hostNamservers = resolvconf.GetNameservers(resolvConf, types.IP)
|
|
hostSearch = resolvconf.GetSearchDomains(resolvConf)
|
|
hostSearch = resolvconf.GetSearchDomains(resolvConf)
|
|
|
|
|
|
out, _ = dockerCmd(c, "run", "busybox", "cat", "/etc/resolv.conf")
|
|
out, _ = dockerCmd(c, "run", "busybox", "cat", "/etc/resolv.conf")
|
|
- if actualNameservers = resolvconf.GetNameservers([]byte(out), netutils.IP); string(actualNameservers[0]) != "12.34.56.78" || len(actualNameservers) != 1 {
|
|
|
|
|
|
+ if actualNameservers = resolvconf.GetNameservers([]byte(out), types.IP); string(actualNameservers[0]) != "12.34.56.78" || len(actualNameservers) != 1 {
|
|
c.Fatalf("expected '12.34.56.78', but has: %v", actualNameservers)
|
|
c.Fatalf("expected '12.34.56.78', but has: %v", actualNameservers)
|
|
}
|
|
}
|
|
|
|
|