mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
fix(region): avoid cidr change 0.0.0.0/0
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user