mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-05 20:54:18 +08:00
commit
e3de513b92
2 changed files with 2 additions and 8 deletions
|
@ -39,16 +39,12 @@ func ValidateEgressReq(e *schema.Egress) error {
|
|||
func DoesNodeHaveAccessToEgress(node *models.Node, e *schema.Egress, acls []models.Acl) bool {
|
||||
nodeTags := maps.Clone(node.Tags)
|
||||
nodeTags[models.TagID(node.ID.String())] = struct{}{}
|
||||
nodeTags[models.TagID("*")] = struct{}{}
|
||||
for _, acl := range acls {
|
||||
if !acl.Enabled {
|
||||
continue
|
||||
}
|
||||
srcVal := ConvAclTagToValueMap(acl.Src)
|
||||
if acl.AllowedDirection == models.TrafficDirectionBi {
|
||||
if _, ok := srcVal["*"]; ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for _, dstI := range acl.Dst {
|
||||
|
||||
if dstI.ID == models.NodeTagID && dstI.Value == "*" {
|
||||
|
|
|
@ -190,9 +190,7 @@ func CreateIngressGateway(netid string, nodeid string, ingress models.IngressReq
|
|||
}
|
||||
node.IsIngressGateway = true
|
||||
node.IsGw = true
|
||||
if !servercfg.IsPro {
|
||||
node.IsInternetGateway = ingress.IsInternetGateway
|
||||
}
|
||||
node.IsInternetGateway = ingress.IsInternetGateway
|
||||
node.IngressGatewayRange = network.AddressRange
|
||||
node.IngressGatewayRange6 = network.AddressRange6
|
||||
node.IngressDNS = ingress.ExtclientDNS
|
||||
|
|
Loading…
Add table
Reference in a new issue