Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1781 from weaveworks/1754-no-with-dns
Browse files Browse the repository at this point in the history
Remove --with-dns option from proxy
  • Loading branch information
awh committed Dec 16, 2015
2 parents cbaa92d + 68d6c26 commit ce18509
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
5 changes: 0 additions & 5 deletions prog/weaveproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func main() {
mflag.BoolVar(&c.TLSConfig.Enabled, []string{"#tls", "-tls"}, false, "Use TLS; implied by --tlsverify")
mflag.StringVar(&c.TLSConfig.Key, []string{"#tlskey", "-tlskey"}, "", "Path to TLS key file")
mflag.BoolVar(&c.TLSConfig.Verify, []string{"#tlsverify", "-tlsverify"}, false, "Use TLS and verify the remote")
mflag.BoolVar(&c.WithDNS, []string{"-with-dns", "w"}, false, "instruct created containers to always use weaveDNS as their nameserver")
mflag.BoolVar(&c.WithoutDNS, []string{"-without-dns"}, false, "instruct created containers to never use weaveDNS as their nameserver")
mflag.BoolVar(&c.NoMulticastRoute, []string{"-no-multicast-route"}, false, "do not add a multicast route via the weave interface when attaching containers")
mflag.Parse()
Expand All @@ -49,10 +48,6 @@ func main() {
os.Exit(0)
}

if c.WithDNS && c.WithoutDNS {
Log.Fatalf("Cannot use both '--with-dns' and '--without-dns' flags")
}

SetLogLevel(logLevel)

if image := os.Getenv("EXEC_IMAGE"); image != "" {
Expand Down
6 changes: 0 additions & 6 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
docker "github.com/fsouza/go-dockerclient"
. "github.com/weaveworks/weave/common"
weavedocker "github.com/weaveworks/weave/common/docker"
"github.com/weaveworks/weave/nameserver"
)

const (
Expand Down Expand Up @@ -56,7 +55,6 @@ type Config struct {
NoRewriteHosts bool
TLSConfig TLSConfig
Version string
WithDNS bool
WithoutDNS bool
NoMulticastRoute bool
DockerHost string
Expand Down Expand Up @@ -519,10 +517,6 @@ func (proxy *Proxy) getDNSDomain() (domain string) {
return ""
}

if proxy.WithDNS {
domain = nameserver.DefaultDomain
}

weaveContainer, err := proxy.client.InspectContainer("weave")
var weaveIP string
if err == nil && weaveContainer.NetworkSettings != nil {
Expand Down
5 changes: 0 additions & 5 deletions test/630_proxy_dns_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ start_suite "Proxy registers containers with dns"

bridge_ip=$(weave_on $HOST1 docker-bridge-ip)

# Assert behaviour without weaveDNS running, but dns forced
weave_on $HOST1 launch-proxy --with-dns
do_assert_resolution assert_no_dns_record
weave_on $HOST1 stop-proxy

# Assert behaviour without weaveDNS
weave_on $HOST1 launch-proxy
do_assert_resolution assert_no_dns_record
Expand Down
2 changes: 1 addition & 1 deletion weave
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ weave launch [--password <password>] [--nickname <nickname>]
weave launch-router [--password <password>] [--nickname <nickname>]
[--ipalloc-range <cidr> [--ipalloc-default-subnet <cidr>]]
[--no-discovery] [--init-peer-count <count>] <peer> ...
weave launch-proxy [-H <endpoint>] [--with-dns | --without-dns]
weave launch-proxy [-H <endpoint>] [--without-dns]
[--no-default-ipalloc] [--no-rewrite-hosts]
[--no-multicast-route]
[--hostname-from-label <labelkey>]
Expand Down

0 comments on commit ce18509

Please sign in to comment.