Browse Source

NET-600 (#2571)

* NET-600

* Ext clients dns now properly set from ingress dns value provided that the individual ext client dns are not present.

* NET-468 & NET-600

* When individual extclient dns is changed or removed, it reflects on the UI properly and also gets updated on backend.
Farukh Khan 1 year ago
parent
commit
7c4870e82f
2 changed files with 6 additions and 1 deletions
  1. 5 0
      controllers/ext_client.go
  2. 1 1
      logic/extpeers.go

+ 5 - 0
controllers/ext_client.go

@@ -385,6 +385,11 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
 	extclient.RemoteAccessClientID = customExtClient.RemoteAccessClientID
 	extclient.RemoteAccessClientID = customExtClient.RemoteAccessClientID
 	extclient.IngressGatewayID = nodeid
 	extclient.IngressGatewayID = nodeid
 
 
+	// set extclient dns to ingressdns if extclient dns is not explicitly set
+	if (extclient.DNS == "") && (node.IngressDNS != "") {
+		extclient.DNS = node.IngressDNS
+	}
+
 	extclient.Network = node.Network
 	extclient.Network = node.Network
 	host, err := logic.GetHost(node.HostID.String())
 	host, err := logic.GetHost(node.HostID.String())
 	if err != nil {
 	if err != nil {

+ 1 - 1
logic/extpeers.go

@@ -225,7 +225,7 @@ func UpdateExtClient(old *models.ExtClient, update *models.CustomExtClient) mode
 	if update.PublicKey != "" && old.PublicKey != update.PublicKey {
 	if update.PublicKey != "" && old.PublicKey != update.PublicKey {
 		new.PublicKey = update.PublicKey
 		new.PublicKey = update.PublicKey
 	}
 	}
-	if update.DNS != "" && update.DNS != old.DNS {
+	if update.DNS != old.DNS {
 		new.DNS = update.DNS
 		new.DNS = update.DNS
 	}
 	}
 	if update.Enabled != old.Enabled {
 	if update.Enabled != old.Enabled {