Skip to content

Commit

Permalink
Replicate missing changes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mjethwa-msft committed Sep 3, 2024
1 parent d0fc590 commit 38bf694
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions services/network/networksecuritygroup/wssd.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,41 +274,25 @@ func getWssdNetworkSecurityGroupRules(securityRules *[]network.SecurityRule, isD
if rule.SourceAddressPrefix != nil && len(*rule.SourceAddressPrefix) > 0 {
wssdCloudNSGRule.SourceAddressPrefix = *rule.SourceAddressPrefix
} else if rule.SourceAddressPrefixes != nil {
concatRule := ""
for _, prefix := range *rule.SourceAddressPrefixes {
concatRule += prefix
}
wssdCloudNSGRule.SourceAddressPrefix = concatRule
wssdCloudNSGRule.SourceAddressPrefix = strings.Join(*rule.SourceAddressPrefixes, ",")
}

if rule.DestinationAddressPrefix != nil && len(*rule.DestinationAddressPrefix) > 0 {
wssdCloudNSGRule.DestinationAddressPrefix = *rule.DestinationAddressPrefix
} else if rule.DestinationAddressPrefixes != nil {
concatRule := ""
for _, prefix := range *rule.DestinationAddressPrefixes {
concatRule += prefix
}
wssdCloudNSGRule.DestinationAddressPrefix = concatRule
wssdCloudNSGRule.DestinationAddressPrefix = strings.Join(*rule.DestinationAddressPrefixes, ",")
}

if rule.SourcePortRange != nil && len(*rule.SourcePortRange) > 0 {
wssdCloudNSGRule.SourcePortRange = *rule.SourcePortRange
} else if rule.SourcePortRanges != nil {
concatRule := ""
for _, prefix := range *rule.SourcePortRanges {
concatRule += prefix
}
wssdCloudNSGRule.SourcePortRange = concatRule
wssdCloudNSGRule.SourcePortRange = strings.Join(*rule.SourcePortRanges, ",")
}

if rule.DestinationPortRange != nil && len(*rule.DestinationPortRange) > 0 {
wssdCloudNSGRule.DestinationPortRange = *rule.DestinationPortRange
} else if rule.DestinationPortRanges != nil {
concatRule := ""
for _, prefix := range *rule.DestinationPortRanges {
concatRule += prefix
}
wssdCloudNSGRule.DestinationPortRange = concatRule
wssdCloudNSGRule.DestinationPortRange = strings.Join(*rule.DestinationPortRanges, ",")
}

if strings.EqualFold(string(rule.Access), string(network.SecurityRuleAccessAllow)) {
Expand Down

0 comments on commit 38bf694

Please sign in to comment.