diff --git a/services/network/networksecuritygroup/wssd.go b/services/network/networksecuritygroup/wssd.go index 6e4707cd..3ecbad3f 100644 --- a/services/network/networksecuritygroup/wssd.go +++ b/services/network/networksecuritygroup/wssd.go @@ -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)) {