introduce WEAVEDNS_DOCKER_ARGS

same purpuse as WEAVE_DOCKER_ARGS, except for weavedns
This allows us to get rid if the -fallback option since
WEAVEDNS_DOCKER_ARGS="--dns=..." has the same effect.

Closes #487.
This commit is contained in:
Matthias Radestock committed 2015-03-31 11:50:41 +01:00
1 parent b50688b4de
commit de557a3e03
2 files changed
+5 -13

No files matched your search

+5 -1
View File
@@ -57,6 +57,7 @@ exec_remote() {
-v "$PROCFS":/hostproc \
-e VERSION \
-e WEAVE_DOCKER_ARGS \
-e WEAVEDNS_DOCKER_ARGS \
-e WEAVE_PASSWORD \
-e DOCKER_BRIDGE \
-e PROCFS=/hostproc --privileged --net=host \
@@ -587,9 +588,12 @@ case "$COMMAND" in
check_not_running $DNS_CONTAINER_NAME $BASE_DNS_IMAGE
create_bridge
docker_bridge_ip
# Set WEAVEDNS_DOCKER_ARGS in the environment in order to supply
# additional parameters, such as resource limits, to docker
# when launching the weave container.
DNS_CONTAINER=$(docker run --privileged -d --name=$DNS_CONTAINER_NAME \
-p $DOCKER_BRIDGE_IP:53:53/udp -v /var/run/docker.sock:/var/run/docker.sock \
$DNS_IMAGE -iface $CONTAINER_IFNAME "$@")
$WEAVEDNS_DOCKER_ARGS $DNS_IMAGE -iface $CONTAINER_IFNAME "$@")
with_container_netns $DNS_CONTAINER attach $CIDR >/dev/null
populate_dns
echo $DNS_CONTAINER
-12
View File
@@ -3,7 +3,6 @@ package main
import (
"flag"
"fmt"
"github.com/miekg/dns"
. "github.com/zettio/weave/common"
weavedns "github.com/zettio/weave/nameserver"
weavenet "github.com/zettio/weave/net"
@@ -23,7 +22,6 @@ func main() {
ifaceName string
apiPath string
localDomain string
fallback string
dnsPort int
httpPort int
wait int
@@ -42,7 +40,6 @@ func main() {
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
flag.IntVar(&dnsPort, "dnsport", weavedns.DefaultServerPort, "port to listen to DNS requests")
flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests")
flag.StringVar(&fallback, "fallback", "", "force a fallback (ie, '8.8.8.8:53') instead of /etc/resolv.conf values")
flag.IntVar(&timeout, "timeout", weavedns.DefaultTimeout, "timeout for resolutions")
flag.IntVar(&udpbuf, "udpbuf", weavedns.DefaultUDPBuflen, "UDP buffer length")
flag.IntVar(&cacheLen, "cache", weavedns.DefaultCacheLen, "cache length")
@@ -86,15 +83,6 @@ func main() {
UDPBufLen: udpbuf,
}
if len(fallback) > 0 {
fallbackHost, fallbackPort, err := net.SplitHostPort(fallback)
if err != nil {
Error.Fatal("Could not parse fallback host and port", err)
}
srvConfig.UpstreamCfg = &dns.ClientConfig{Servers: []string{fallbackHost}, Port: fallbackPort}
Debug.Printf("DNS fallback at %s:%s", fallbackHost, fallbackPort)
}
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
if err != nil {
Error.Fatal("Failed to initialize the WeaveDNS server", err)