Merge pull request #880 from gravitl/feature_0.12.0_host_dns

don't update dns on comms network peer update
This commit is contained in:
dcarns 2022-03-10 14:53:29 -05:00 committed by GitHub
commit f53b9a68e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,6 @@ import (
"time"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/gravitl/netmaker/logger"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/netclient/config"
"github.com/gravitl/netmaker/netclient/local"
@ -197,7 +196,11 @@ func UpdatePeers(client mqtt.Client, msg mqtt.Message) {
ncutils.Log("error syncing wg after peer update: " + err.Error())
return
}
logger.Log(0, "DNS updating /etc/hosts")
//skip dns updates if this is a peer update for comms network
if cfg.Node.NetworkSettings.IsComms == "yes" {
return
}
ncutils.Log("DNS updating /etc/hosts")
if cfg.Node.DNSOn == "yes" {
if err := setHostDNS(peerUpdate.DNS, ncutils.IsWindows()); err != nil {
ncutils.Log("error updating /etc/hosts " + err.Error())