mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
fix old acls migration
This commit is contained in:
@@ -25,6 +25,9 @@ func CreateNodeACL(networkID NetworkID, nodeID NodeID, defaultVal byte) (acls.AC
|
|||||||
acls.AclMutex.Lock()
|
acls.AclMutex.Lock()
|
||||||
var newNodeACL = make(acls.ACL)
|
var newNodeACL = make(acls.ACL)
|
||||||
for existingNodeID := range currentNetworkACL {
|
for existingNodeID := range currentNetworkACL {
|
||||||
|
if currentNetworkACL[existingNodeID] == nil {
|
||||||
|
currentNetworkACL[existingNodeID] = make(acls.ACL)
|
||||||
|
}
|
||||||
currentNetworkACL[existingNodeID][acls.AclID(nodeID)] = defaultVal // set the old nodes to default value for new node
|
currentNetworkACL[existingNodeID][acls.AclID(nodeID)] = defaultVal // set the old nodes to default value for new node
|
||||||
newNodeACL[existingNodeID] = defaultVal // set the old nodes in new node ACL to default value
|
newNodeACL[existingNodeID] = defaultVal // set the old nodes in new node ACL to default value
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user