Replace noDNS by dns in plugin
Just to avoid double negation.
This commit is contained in:
1 parent
09606db9c3
commit
1a3537a8f4
4 files changed
+12
-12
No files matched your search
@@ -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),
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user