Skip to content

Commit

Permalink
fix all resources rules
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Dec 11, 2024
1 parent 94cc853 commit effb7eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion logic/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
5 changes: 5 additions & 0 deletions logic/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ func GetTagMapWithNodesByNetwork(netID models.NetworkID, withStaticNodes bool) (
tagNodesMap[nodeTagID] = append(tagNodesMap[nodeTagID], nodeI)
}
}
tagNodesMap["*"] = nodes
if !withStaticNodes {
return
}
Expand All @@ -850,6 +851,10 @@ func AddTagMapWithStaticNodes(netID models.NetworkID,
IsStatic: true,
StaticNode: extclient,
})
tagNodesMap["*"] = append(tagNodesMap["*"], models.Node{
IsStatic: true,
StaticNode: extclient,
})
}

}
Expand Down

0 comments on commit effb7eb

Please sign in to comment.