Skip to content

Commit

Permalink
Merge pull request #3198 from gravitl/NET-1773-tags
Browse files Browse the repository at this point in the history
NET-1773: avoid adding static nodes to tags
  • Loading branch information
abhishek9686 authored Nov 11, 2024
2 parents d485a30 + dcbe94e commit e1ef3b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions controllers/ext_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions pro/controllers/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e1ef3b5

Please sign in to comment.