From 941c49e85469e168a006a088bdaef7a8538a0996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Fri, 11 Oct 2024 17:53:47 +0800 Subject: [PATCH] fix(region): gcp security group check (#21386) --- pkg/compute/models/vpcs.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/compute/models/vpcs.go b/pkg/compute/models/vpcs.go index 1671dbf5b3..37a71879d3 100644 --- a/pkg/compute/models/vpcs.go +++ b/pkg/compute/models/vpcs.go @@ -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 }