add remoteaccess tag to extclients

This commit is contained in:
abhishek9686 2024-10-18 14:25:55 +04:00
parent 298749b76c
commit d8a0398b2a

View file

@ -171,6 +171,9 @@ func updateNodes() {
if node.IsIngressGateway {
tagID := models.TagID(fmt.Sprintf("%s.%s", node.Network,
models.RemoteAccessTagName))
if node.Tags == nil {
node.Tags = make(map[models.TagID]struct{})
}
if _, ok := node.Tags[tagID]; !ok {
node.Tags[tagID] = struct{}{}
logic.UpsertNode(&node)
@ -186,6 +189,18 @@ 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) {