fix all resources rules

This commit is contained in:
abhishek9686 2024-12-12 02:30:32 +04:00
parent 94cc85377f
commit effb7eb5d7
2 changed files with 8 additions and 1 deletions

View file

@ -844,6 +844,7 @@ func GetAclRulesForNode(targetnode *models.Node) (rules map[string]models.AclRul
}
acls := listDevicePolicies(models.NetworkID(targetnode.Network))
targetnode.Tags["*"] = struct{}{}
for nodeTag := range targetnode.Tags {
for _, acl := range acls {
if !acl.Enabled {
@ -944,7 +945,8 @@ func GetAclRulesForNode(targetnode *models.Node) (rules map[string]models.AclRul
}
}
} else {
if _, ok := dstTags[nodeTag.String()]; ok {
_, all := dstTags["*"]
if _, ok := dstTags[nodeTag.String()]; ok || all {
// get all src tags
for src := range srcTags {
if src == nodeTag.String() {

View file

@ -829,6 +829,7 @@ func GetTagMapWithNodesByNetwork(netID models.NetworkID, withStaticNodes bool) (
tagNodesMap[nodeTagID] = append(tagNodesMap[nodeTagID], nodeI)
}
}
tagNodesMap["*"] = nodes
if !withStaticNodes {
return
}
@ -850,6 +851,10 @@ func AddTagMapWithStaticNodes(netID models.NetworkID,
IsStatic: true,
StaticNode: extclient,
})
tagNodesMap["*"] = append(tagNodesMap["*"], models.Node{
IsStatic: true,
StaticNode: extclient,
})
}
}