mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-05 20:54:18 +08:00
avoid adding static nodes to tags
This commit is contained in:
parent
d485a3060f
commit
dcbe94eeb5
3 changed files with 4 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue