summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-08-08 14:54:19 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-08-08 15:25:50 -0400
commit5270cd89d33203ffc3239be2b5ed1b60afd9d867 (patch)
tree9228f9fa359efee601974e9f5f91e2e92d8b375e
parent3959a357f7cefc9e3494042781fe0978e621cccc (diff)
downloadpodman-5270cd89d33203ffc3239be2b5ed1b60afd9d867.tar.gz
podman-5270cd89d33203ffc3239be2b5ed1b60afd9d867.tar.bz2
podman-5270cd89d33203ffc3239be2b5ed1b60afd9d867.zip
Allow the passing of '.' to --dns-search
--dns-search is defined to remove all search domains from a container. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
-rw-r--r--cmd/podman/shared/create.go3
-rw-r--r--test/e2e/run_dns_test.go7
2 files changed, 10 insertions, 0 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go
index 8e356cbcb..7dccc41f1 100644
--- a/cmd/podman/shared/create.go
+++ b/cmd/podman/shared/create.go
@@ -629,6 +629,9 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
// Validate domains are good
for _, dom := range c.StringSlice("dns-search") {
+ if dom == "." {
+ continue
+ }
if _, err := parse.ValidateDomain(dom); err != nil {
return nil, err
}
diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go
index 081fab3fd..dc0f4a8fb 100644
--- a/test/e2e/run_dns_test.go
+++ b/test/e2e/run_dns_test.go
@@ -41,6 +41,13 @@ var _ = Describe("Podman run dns", func() {
session.LineInOuputStartsWith("search foobar.com")
})
+ It("podman run remove all search domain", func() {
+ session := podmanTest.Podman([]string{"run", "--dns-search=.", ALPINE, "cat", "/etc/resolv.conf"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.LineInOuputStartsWith("search")).To(BeFalse())
+ })
+
It("podman run add bad dns server", func() {
session := podmanTest.Podman([]string{"run", "--dns=foobar", ALPINE, "ls"})
session.WaitWithDefaultTimeout()