mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-03 17:31:13 +01:00
[management] copy destination and source resource on policyRUle copy (#3235)
This commit is contained in:
parent
a32ec97911
commit
7335c82553
@ -66,18 +66,20 @@ type PolicyRule struct {
|
|||||||
// Copy returns a copy of a policy rule
|
// Copy returns a copy of a policy rule
|
||||||
func (pm *PolicyRule) Copy() *PolicyRule {
|
func (pm *PolicyRule) Copy() *PolicyRule {
|
||||||
rule := &PolicyRule{
|
rule := &PolicyRule{
|
||||||
ID: pm.ID,
|
ID: pm.ID,
|
||||||
PolicyID: pm.PolicyID,
|
PolicyID: pm.PolicyID,
|
||||||
Name: pm.Name,
|
Name: pm.Name,
|
||||||
Description: pm.Description,
|
Description: pm.Description,
|
||||||
Enabled: pm.Enabled,
|
Enabled: pm.Enabled,
|
||||||
Action: pm.Action,
|
Action: pm.Action,
|
||||||
Destinations: make([]string, len(pm.Destinations)),
|
Destinations: make([]string, len(pm.Destinations)),
|
||||||
Sources: make([]string, len(pm.Sources)),
|
DestinationResource: pm.DestinationResource,
|
||||||
Bidirectional: pm.Bidirectional,
|
Sources: make([]string, len(pm.Sources)),
|
||||||
Protocol: pm.Protocol,
|
SourceResource: pm.SourceResource,
|
||||||
Ports: make([]string, len(pm.Ports)),
|
Bidirectional: pm.Bidirectional,
|
||||||
PortRanges: make([]RulePortRange, len(pm.PortRanges)),
|
Protocol: pm.Protocol,
|
||||||
|
Ports: make([]string, len(pm.Ports)),
|
||||||
|
PortRanges: make([]RulePortRange, len(pm.PortRanges)),
|
||||||
}
|
}
|
||||||
copy(rule.Destinations, pm.Destinations)
|
copy(rule.Destinations, pm.Destinations)
|
||||||
copy(rule.Sources, pm.Sources)
|
copy(rule.Sources, pm.Sources)
|
||||||
|
Loading…
Reference in New Issue
Block a user