Browse Source

Merge pull request #3689 from gravitl/fix/node-dns

Set DNS if not
Vishal Dalwadi 2 months ago
parent
commit
593d754e47
1 changed files with 5 additions and 0 deletions
  1. 5 0
      logic/hosts.go

+ 5 - 0
logic/hosts.go

@@ -7,6 +7,7 @@ import (
 	"fmt"
 	"fmt"
 	"os"
 	"os"
 	"sort"
 	"sort"
+	"strings"
 	"sync"
 	"sync"
 
 
 	"github.com/google/uuid"
 	"github.com/google/uuid"
@@ -292,6 +293,10 @@ func UpdateHost(newHost, currentHost *models.Host) {
 	if newHost.PersistentKeepalive == 0 {
 	if newHost.PersistentKeepalive == 0 {
 		newHost.PersistentKeepalive = currentHost.PersistentKeepalive
 		newHost.PersistentKeepalive = currentHost.PersistentKeepalive
 	}
 	}
+
+	if strings.TrimSpace(newHost.DNS) == "" {
+		newHost.DNS = currentHost.DNS
+	}
 }
 }
 
 
 // UpdateHostFromClient - used for updating host on server with update recieved from client
 // UpdateHostFromClient - used for updating host on server with update recieved from client