Sfoglia il codice sorgente

Merge pull request #3198 from gravitl/NET-1773-tags

NET-1773: avoid adding static nodes to tags
Abhishek K 10 mesi fa
parent
commit
e1ef3b5d6c
3 ha cambiato i file con 4 aggiunte e 16 eliminazioni
  1. 2 2
      controllers/ext_client.go
  2. 0 12
      migrate/migrate.go
  3. 2 2
      pro/controllers/users.go

+ 2 - 2
controllers/ext_client.go

@@ -470,8 +470,8 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
 	extclient.IngressGatewayID = nodeid
 	extclient.Network = node.Network
 	extclient.Tags = make(map[models.TagID]struct{})
-	extclient.Tags[models.TagID(fmt.Sprintf("%s.%s", extclient.Network,
-		models.RemoteAccessTagName))] = struct{}{}
+	// extclient.Tags[models.TagID(fmt.Sprintf("%s.%s", extclient.Network,
+	// 	models.RemoteAccessTagName))] = struct{}{}
 	// set extclient dns to ingressdns if extclient dns is not explicitly set
 	if (extclient.DNS == "") && (node.IngressDNS != "") {
 		extclient.DNS = node.IngressDNS

+ 0 - 12
migrate/migrate.go

@@ -226,18 +226,6 @@ func updateNodes() {
 			}
 		}
 	}
-	extclients, _ := logic.GetAllExtClients()
-	for _, extclient := range extclients {
-		tagID := models.TagID(fmt.Sprintf("%s.%s", extclient.Network,
-			models.RemoteAccessTagName))
-		if extclient.Tags == nil {
-			extclient.Tags = make(map[models.TagID]struct{})
-		}
-		if _, ok := extclient.Tags[tagID]; !ok {
-			extclient.Tags[tagID] = struct{}{}
-			logic.SaveExtClient(&extclient)
-		}
-	}
 }
 
 func removeInterGw(egressRanges []string) ([]string, bool) {

+ 2 - 2
pro/controllers/users.go

@@ -1006,8 +1006,8 @@ func getRemoteAccessGatewayConf(w http.ResponseWriter, r *http.Request) {
 			userConf.Enabled = parentNetwork.DefaultACL == "yes"
 		}
 		userConf.Tags = make(map[models.TagID]struct{})
-		userConf.Tags[models.TagID(fmt.Sprintf("%s.%s", userConf.Network,
-			models.RemoteAccessTagName))] = struct{}{}
+		// userConf.Tags[models.TagID(fmt.Sprintf("%s.%s", userConf.Network,
+		// 	models.RemoteAccessTagName))] = struct{}{}
 		if err = logic.CreateExtClient(&userConf); err != nil {
 			slog.Error(
 				"failed to create extclient",