mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
fix(region): gcp security group check (#21386)
This commit is contained in:
@@ -2036,14 +2036,14 @@ func (self *SVpc) CheckSecurityGroupConsistent(secgroup *SSecurityGroup) error {
|
||||
if secgroup.VpcId != self.Id {
|
||||
return httperrors.NewInvalidStatusError("The security group does not belong to the vpc")
|
||||
}
|
||||
} else if len(secgroup.CloudregionId) > 0 {
|
||||
if secgroup.CloudregionId != self.CloudregionId {
|
||||
return httperrors.NewInvalidStatusError("The security group and vpc are in different areas")
|
||||
}
|
||||
} else if len(secgroup.GlobalvpcId) > 0 {
|
||||
if secgroup.GlobalvpcId != self.GlobalvpcId {
|
||||
return httperrors.NewInvalidStatusError("The security group and vpc are in different global vpc")
|
||||
}
|
||||
} else if len(secgroup.CloudregionId) > 0 {
|
||||
if secgroup.CloudregionId != self.CloudregionId {
|
||||
return httperrors.NewInvalidStatusError("The security group and vpc are in different areas")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user