fix(region): gcp security group check (#21386)

This commit is contained in:
屈轩
2024-10-11 17:53:47 +08:00
committed by GitHub
parent 6720135a84
commit 941c49e854
+4 -4
View File
@@ -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
}