Replace noDNS by dns in plugin

Just to avoid double negation.
This commit is contained in:
Martynas Pumputis authored and Bryan Boreham committed 2017-04-12 13:05:40 +00:00
1 parent 09606db9c3
commit 1a3537a8f4
4 files changed
+12 -12

No files matched your search

+3 -3
View File
@@ -31,18 +31,18 @@ type driver struct {
name string
scope string
docker *docker.Client
noDNS bool
dns bool
isPluginV2 bool
sync.RWMutex
networks map[string]network
}
func New(client *docker.Client, weave *weaveapi.Client, name, scope string, noDNS, isPluginV2 bool) (skel.Driver, error) {
func New(client *docker.Client, weave *weaveapi.Client, name, scope string, dns, isPluginV2 bool) (skel.Driver, error) {
driver := &driver{
name: name,
scope: scope,
docker: client,
noDNS: noDNS,
dns: dns,
isPluginV2: isPluginV2,
networks: make(map[string]network),
}
+1 -1
View File
@@ -41,7 +41,7 @@ func (w *watcher) ContainerStarted(id string) {
continue
}
if network.isOurs {
if !w.driver.noDNS {
if w.driver.dns {
fqdn := fmt.Sprintf("%s.%s", info.Config.Hostname, info.Config.Domainname)
if err := w.weave.RegisterWithDNS(id, fqdn, net.IPAddress); err != nil {
w.driver.warn("ContainerStarted", "unable to register %s with weaveDNS: %s", id, err)