替换有远端安全组的规则,避免网络不通

This commit is contained in:
ioito
2019-06-24 17:36:15 +08:00
parent 7e45338afb
commit b09f2528b4
+4
View File
@@ -312,6 +312,10 @@ func (region *SRegion) syncSecgroupRules(secgroupId string, rules []secrules.Sec
ruleStr := rules[i].String()
cmp := strings.Compare(_ruleStr, ruleStr)
if cmp == 0 {
if len(secgroup.Rules[j].RemoteSecurityGroupUUID) > 0 {
delRuleIds = append(delRuleIds, secgroup.Rules[j].UUID)
addRules = append(addRules, rules[i])
}
i++
j++
} else if cmp > 0 {