From e4828ad30a10b0383d4762f7ea289987bb36f4a2 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 7 Dec 2015 13:25:05 +0000 Subject: [PATCH] Remove 'nameserver' option --- plugin/net/driver.go | 12 +----------- prog/plugin/main.go | 10 ++++------ 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/plugin/net/driver.go b/plugin/net/driver.go index 12b4a62f..0af2c1be 100644 --- a/plugin/net/driver.go +++ b/plugin/net/driver.go @@ -22,16 +22,14 @@ const ( type driver struct { version string - nameserver string scope string noMulticastRoute bool sync.RWMutex endpoints map[string]struct{} } -func New(client *docker.Client, version string, nameserver string, scope string, noMulticastRoute bool) (skel.Driver, error) { +func New(client *docker.Client, version string, scope string, noMulticastRoute bool) (skel.Driver, error) { driver := &driver{ - nameserver: nameserver, noMulticastRoute: noMulticastRoute, version: version, scope: scope, @@ -156,14 +154,6 @@ func (driver *driver) JoinEndpoint(j *api.JoinRequest) (*api.JoinResponse, error response := &api.JoinResponse{ InterfaceName: ifname, } - if driver.nameserver != "" { - routeToDNS := api.StaticRoute{ - Destination: driver.nameserver + "/32", - RouteType: types.CONNECTED, - NextHop: "", - } - response.StaticRoutes = []api.StaticRoute{routeToDNS} - } if !driver.noMulticastRoute { multicastRoute := api.StaticRoute{ Destination: "224.0.0.0/4", diff --git a/prog/plugin/main.go b/prog/plugin/main.go index 464ab9a9..ad642069 100644 --- a/prog/plugin/main.go +++ b/prog/plugin/main.go @@ -20,7 +20,6 @@ func main() { var ( justVersion bool address string - nameserver string meshAddress string logLevel string noMulticastRoute bool @@ -29,7 +28,6 @@ func main() { flag.BoolVar(&justVersion, "version", false, "print version and exit") flag.StringVar(&logLevel, "log-level", "info", "logging level (debug, info, warning, error)") flag.StringVar(&address, "socket", "/run/docker/plugins/weave.sock", "socket on which to listen") - flag.StringVar(&nameserver, "nameserver", "", "nameserver to provide to containers") flag.StringVar(&meshAddress, "meshsocket", "/run/docker/plugins/weavemesh.sock", "socket on which to listen in mesh mode") flag.BoolVar(&noMulticastRoute, "no-multicast-route", false, "do not add a multicast route to network endpoints") @@ -53,14 +51,14 @@ func main() { endChan := make(chan error, 1) if address != "" { - globalListener, err := listenAndServe(dockerClient, address, nameserver, noMulticastRoute, endChan, "global", false) + globalListener, err := listenAndServe(dockerClient, address, noMulticastRoute, endChan, "global", false) if err != nil { Log.Fatalf("unable to create driver: %s", err) } defer globalListener.Close() } if meshAddress != "" { - meshListener, err := listenAndServe(dockerClient, meshAddress, nameserver, noMulticastRoute, endChan, "local", true) + meshListener, err := listenAndServe(dockerClient, meshAddress, noMulticastRoute, endChan, "local", true) if err != nil { Log.Fatalf("unable to create driver: %s", err) } @@ -74,8 +72,8 @@ func main() { } } -func listenAndServe(dockerClient *docker.Client, address, nameserver string, noMulticastRoute bool, endChan chan<- error, scope string, withIpam bool) (net.Listener, error) { - d, err := netplugin.New(dockerClient, version, nameserver, scope, noMulticastRoute) +func listenAndServe(dockerClient *docker.Client, address string, noMulticastRoute bool, endChan chan<- error, scope string, withIpam bool) (net.Listener, error) { + d, err := netplugin.New(dockerClient, version, scope, noMulticastRoute) if err != nil { return nil, err }