mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-13 00:24:31 +08:00
support static nodes in standalone device policies
This commit is contained in:
parent
9a40717b5b
commit
46d79ee512
1 changed files with 12 additions and 6 deletions
|
@ -280,12 +280,15 @@ func IsAclPolicyValid(acl models.Acl) bool {
|
|||
return false
|
||||
}
|
||||
} else {
|
||||
_, err := GetNodeByID(dstI.Value)
|
||||
if err != nil {
|
||||
_, nodeErr := GetNodeByID(dstI.Value)
|
||||
if nodeErr != nil {
|
||||
_, staticNodeErr := GetExtClient(dstI.Value, acl.NetworkID.String())
|
||||
if staticNodeErr != nil {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case models.DevicePolicy:
|
||||
for _, srcI := range acl.Src {
|
||||
if srcI.ID == "" || srcI.Value == "" {
|
||||
|
@ -329,13 +332,16 @@ func IsAclPolicyValid(acl models.Acl) bool {
|
|||
return false
|
||||
}
|
||||
} else {
|
||||
_, err := GetNodeByID(dstI.Value)
|
||||
if err != nil {
|
||||
_, nodeErr := GetNodeByID(dstI.Value)
|
||||
if nodeErr != nil {
|
||||
_, staticNodeErr := GetExtClient(dstI.Value, acl.NetworkID.String())
|
||||
if staticNodeErr != nil {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue