fix(region): avoid cidr change 0.0.0.0/0

This commit is contained in:
Qu Xuan
2021-11-05 10:06:13 +08:00
parent 3a258e01b3
commit 4b5b628fac
+4
View File
@@ -347,6 +347,10 @@ func (self *SSecurityGroupRule) ValidateUpdateData(ctx context.Context, userCred
return input, httperrors.NewOutOfRangeError("Invalid priority %d, must be in range or 1 ~ 100", input.Priority)
}
if len(input.CIDR) == 0 {
input.CIDR = self.CIDR
}
if len(input.PeerSecgroupId) > 0 {
_, err := validators.ValidateModel(userCred, SecurityGroupManager, &input.PeerSecgroupId)
if err != nil {